← All tools

Design & developer tools · Runs in your browser

HTML Entity Encoder & Decoder

Convert special characters to HTML entities or decode entities back to readable text. Your content stays on this device.

Maximum 100,000 characters. Encoding is for HTML text content, not a substitute for application-specific sanitization.

Enter text and choose an action.

What HTML entities are and when to use them

HTML entities, also called character references, are a way to represent characters in markup. A reference begins with an ampersand and ends with a semicolon. For example, & represents an ampersand, while < and > represent the angle brackets used to form HTML tags. Numeric references can represent characters by code point, such as © for the copyright symbol. Browsers interpret these references when rendering a document, so text that looks like markup can be displayed as text instead.

This browser-based HTML entity encoder and decoder gives you a quick way to inspect or transform small snippets without uploading them. The encoder converts ampersands, angle brackets, quotation marks, and apostrophes into references. It handles ampersands first so the references it creates are not encoded again. The decoder relies on the browser’s built-in HTML parsing behavior, which understands common named and numeric references. The result is shown as plain text in an output field; it is never inserted as active page markup.

How to use the encoder and decoder

Paste or type a value into the input box, then choose Encode entities to make reserved characters visible as references. Choose Decode entities when the input already contains references and you need to inspect the characters they represent. Copy the result when it looks right, or use Clear to start over. Empty input is reported rather than silently treated as a successful conversion. Inputs are limited to 100,000 characters to keep browser processing responsive; unusually large documents should be handled with a local editor or project-specific build tool.

Use this utility for debugging HTML snippets, preparing plain text examples for documentation, checking how an entity will display, or comparing encoded and decoded content. It can also help when content has been copied from a CMS and contains visible references. Since the result is ordinary text, you can review it before pasting it into a template or code sample.

Important safety and compatibility notes

Encoding is context-sensitive. HTML text nodes, quoted attributes, JavaScript strings, CSS values, and URLs have different parsing rules. This tool’s encoder is intended for simple HTML text content; it is not a universal escaping function, sanitizer, or security boundary. Do not rely on manual entity conversion alone to make untrusted markup safe. Applications should use their framework’s escaping features and a maintained sanitizer when HTML must be accepted. Avoid placing decoded text directly into an unsafe HTML sink.

Entity names are defined by HTML, and some names are case-sensitive or require a semicolon. Browser parsing handles many edge cases, but a decoder is not a validator for an entire HTML document. This tool works locally in your browser, makes no external API calls, and does not send the entered text to a server. For other common developer tasks, use the URL Encoder / Decoder, JSON to TypeScript Generator, or CSS Box Shadow Generator.

Frequently asked questions

What does an HTML entity encoder do?

It replaces HTML-sensitive characters such as ampersands and angle brackets with character references so they display as text in an HTML text context.

Can I decode named and numeric HTML entities?

Yes. The decoder uses your browser’s built-in HTML parser to decode named entities such as & and numeric references such as ©.

Does this tool send or save my text?

No. Encoding and decoding happen locally in your browser. The tool does not send the input to an API or store it.

Does HTML encoding sanitize unsafe input?

No. Character encoding is not a complete security sanitizer. Use a context-aware escaping library and a reviewed sanitization policy when handling untrusted content in an application.