Quick answer
In well-formed XML, every opening tag must have a matching closing tag.
XML Unclosed Tag
In well-formed XML, every opening tag must have a matching closing tag. If a tag is left unclosed, the parser cannot determine where the element ends.
Common causes
- Forgetting to close a tag before the next opening or the end of the document.
- Missing closing bracket or slash in a self-closing tag.
- Copy-pasting or truncating XML and losing the closing tag.
How to fix
- Ensure every <tag> has a matching </tag> in the correct order.
- Self-closing elements must use <tag /> or <tag/>.
- Validate with an online XML validator to get the exact line and column.
Examples
Bad
<root> <item>value </root>
Good
<root> <item>value</item> </root>
FAQ
- What does unclosed tag mean in XML?
- An opening tag was not closed with a matching </tagname> before the next tag or end of document.
- Can XML have self-closing tags?
- Yes. Use <tag /> or <tag/> for elements with no content (e.g. <br />, <img />).
Fix it now
Try in validator (prefill this example)