Another spelling of the same bytes
Escape XML text
The five characters & < > " ' become named entities.
Decoding restores those entities and numeric character references.
The work stays in this tab.
This tool runs in your browser. Turn on JavaScript to use it.
XML escape
The sample is fixed. It uses the same rule as the form.
- Input
- a<b
- Result
- a<b
How to use it
- 1Paste the text.
- 2Choose encode or decode.
- 3Copy the result.
Good to know
- It does not check that the result is a document.
- This page does not upload the text.
- Text longer than one hundred thousand characters is rejected.
Questions
Does the result leave this browser?
No. The calculation finishes in the current tab.
What does this page leave out?
It does not check that the result is a document.
What if the input is huge?
Past one hundred thousand characters, the page stops and asks you to shorten it.
Related tools
- HTML entity encode and decode
Browsers treat < as the start of a tag. If the characters are meant to be seen, the HTML source needs < instead. This page writes that source. It does not render it.
- Format XML
A long XML line is hard to read. This page indents elements by two spaces, or removes the indent. It does not try to repair a broken tag.
- Escape a JSON string
The result is a JSON string, including the quotes JSON.stringify adds.