# XML to Markdown converter

> Open a .xml file and get a Markdown document with the XML checked for well-formedness, re-indented, and wrapped in an xml code block. The file stays on your device.

Source: https://markdownlens.ayushdev.com/xml-to-markdown · Updated 2026-11-12 · Markdown Lens, free and open source: https://github.com/ayushhagarwal/markdown-lens

Markdown Lens checks that the XML is well-formed, then rebuilds a readable representation without sending the file to a server.

Open the converter: https://markdownlens.ayushdev.com/xml-to-markdown (drop a XML file on the page; it is processed in your browser and not uploaded).

## Steps

1. Choose a .xml file.
2. The converter validates and formats it locally.
3. Review the Markdown and export it.

## Example: XML converted to Markdown

Input: `note.xml` (Single-line XML)

- `<note id="7"><to>Ana</to><subject>Release</subject><body>Ship on Friday</body></note>`

Markdown output:

````markdown
# note

```xml
<note id="7">
  <to>Ana</to>
  <subject>Release</subject>
  <body>Ship on Friday</body>
</note>
```
````

## What the converter preserves

- Well-formed element structure
- Attributes
- Formatted XML output
- A document title from the filename

## Limitations

- Invalid XML is rejected with a line hint where possible.
- DTD or schema validation is not applied.
- XML presentation and processing instructions are not treated as document styling.

## How to convert XML to Markdown

1. Drop a .xml file on this page or choose “Open or convert XML”.
2. If the XML is not well-formed, fix the reported line and try again.
3. Copy the fenced block into documentation, an issue, or a prompt, or download the .md file.

## Frequently asked questions

### Does it fetch remote DTDs or entities?

No. Conversion stays local and is intended for well-formed XML documents, not network-backed entity expansion.

### Is the XML uploaded?

No. Validation and formatting happen in the browser.

### Can it convert XML into Markdown tables?

No. XML is kept as a formatted code block so its structure and attributes are preserved.

## Related

- [JSON to Markdown converter](https://markdownlens.ayushdev.com/json-to-markdown): Pretty-print JSON locally as fenced Markdown.
- [HTML to Markdown converter](https://markdownlens.ayushdev.com/html-to-markdown): Convert local HTML documents into editable Markdown.
