HTML Entity Encoder

Escape text for HTML, or encode every character as a numeric reference.

Up to 200,000 input characters. Output limit: 2,000,000 characters.

Download result

Your input is processed in your browser and is not uploaded to ToolPixels. This tool does not save your input.

How to use it

  1. Paste your input, or load the example.
  2. Choose the options that match your task.
  3. Select Encode entities, then review the result.
  4. Copy the result or download html-entity-encoder.txt.

Escaping HTML text

Special-character mode escapes ampersands, angle brackets, double quotes and single quotes. All-character mode uses decimal Unicode code point references, including for spaces and line breaks. Existing entities are escaped again. This is useful for HTML text and quoted attributes, not JavaScript, CSS or URL contexts. It does not sanitize an HTML document.

Related developer tools