XML parsing error: "not well-formed", "opening and ending tag mismatch"
Last reviewed 2026-09-19
XML parsers stop at the first mistake: an unescaped & or <, a tag that is never closed, or an attribute without quotes. One stray character can make a whole feed, sitemap or export unreadable.
Messages you might see
- “XML Parsing Error: not well-formed”
- “Opening and ending tag mismatch: div line 12 and p”
- “xmlParseEntityRef: no name”
Why it happens
- A raw ampersand or less-than sign in text that should have been escaped (& <).
- Tags that were not closed or were closed in the wrong order.
- Attribute values without quotes, or illegal control characters copied in.
Try this first (free, no tool needed)
- Read the line and column in the error message; the mistake is at or just before that spot.
- Open the file in an editor with XML validation (VS Code, Notepad++ with an XML plugin) to see all the problems at once.
- Escape & as & and < as < in text content.
If that didn't work
These tools run in your browser. Your file is read and repaired on your own device and is never uploaded.
Malformed XML Repair
A forgiving repairer: escapes stray ampersands and less-than signs, closes unclosed and mismatched tags, removes stray closing tags, quotes bare attribute values and strips illegal control characters, leaving comments, CDATA and processing instructions untouched. It fixes structure, not meaning.
Open Malformed XML RepairCommon questions
Is the result exactly what I intended?
It is well-formed XML. Where a fix involves a choice (for example which tag to close), read the result to confirm it matches what you meant.
Is my file uploaded anywhere?
No. The tool runs as a program inside your own browser, so the file is read and repaired on your device and never sent to a server.