HTML Entity Encoder & Decoder
Encode text to HTML entities and decode entities back to text.
This tool needs JavaScript enabled to run in your browser.
What this tool does
This tool encodes text into HTML entities and decodes entities back to text. Encoding replaces characters such as <, >, & and quotes with their entity form, so they display as text instead of being read as markup.
Named, decimal or hex
Named entities such as & are the most readable and are used where a well-known name exists. Decimal (©) and hex (©) numeric references work for any character, including ones without a name. Decoding accepts all three forms.
Why it matters
If user input or test data containing <script> is shown on a page without encoding, the browser treats it as real markup. Encoding is how that text is rendered safely. Decoding is useful when you read entity-laden text out of a page or a feed and want the plain version to assert against.
Common use cases
- Preparing a payload that should display as literal text in HTML.
- Reading entity-encoded text from a page source back to plain text.
- Checking how a special character will appear once rendered.
Frequently asked questions
- Named, decimal or hex?
- Named entities such as &amp; are most readable; decimal and hex numeric references work for any character. Decoding accepts all three.
- Why encode at all?
- So text containing < > & or quotes displays as text instead of being read as markup.
Learning resources
Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.