HTML Entities Encoder & Decoder
Escape characters such as < > & for safe display in HTML, or turn entities back into normal text.
Type or paste text to encode.
How to use the HTML entities tool
- Choose Encode to escape special characters, or Decode to turn entities back into characters.
- Paste your text or code. The result updates as you type.
- Optionally tick Also encode non-ASCII characters to turn letters such as é into numeric entities.
- Copy the result into your HTML.
About this tool
HTML uses characters such as <, > and & as part of its own syntax. To show them as text on a page, they must be written as entities: <, > and &. Quotes are escaped too, so the result is safe inside attribute values.
Decoding understands the full set of named entities, such as , — and €, and numeric entities such as © and 😀. The decoder uses the browser’s own HTML parser in a way that never runs scripts or loads anything.
Frequently asked questions
Which characters are encoded?
& < > " and ' are always encoded. With the non-ASCII option on, every character above the basic ASCII range becomes a numeric entity such as é.
Does encoding make my page secure?
Escaping text before it is placed into HTML is an important part of preventing cross-site scripting, but it must be done in the right context. Use your framework’s built-in escaping where you can.
What is ?
A non-breaking space: a space that does not allow the line to wrap at that point. Decoding turns it into a real non-breaking space character.