freesabai

Developer tools

HTML entities encode and decode

Turn special characters (& < > ") into HTML entities so that code can be shown on a web page safely, and decode entities such as &copy; or &#3585; back into characters. Choose the level, including writing Thai and emoji as numbers. It runs in your browser.

Getting the tool ready…This tool needs JavaScript. If you still see this after a few seconds, JavaScript is switched off in your browser or the page did not load completely: turn JavaScript on or reload the page.

How to use it

  1. Choose "Encode" or "Decode", then type or paste. The result appears at once.
  2. Encode: choose "Basic" (only & < > " '), add named entities (© é €), or write every non-ASCII character as a number.
  3. Press "Copy" or "Download".

Frequently asked questions

Which characters must I encode when I put text in an HTML page?

At least & and < in content, and " (or ') too when the value sits in the quotes of an attribute. The "Basic" level does all of these, and it is the basic defence against user text turning into HTML (XSS).

Do I need to write Thai as entities?

No. If the page declares <meta charset="utf-8">, Thai and emoji can be written directly. The "every non-ASCII character" level is for old systems without UTF-8 support, or HTML email.

Decoding says some entities are not known

The tool knows the standard HTML 4 entities (252 names such as &nbsp;, &copy;, &euro;, &hearts;) and decimal and hex numbers. Other, rarer HTML5 names are left as they are and listed.

Good to know

Your data stays on your device

Everything runs in your browser. What you type, paste or open is not sent to freesabai's servers or anyone else's, and is not kept in the browser: close the page and it is gone. The site only counts how many times this page was opened and how many times someone copied or saved a result (never what was pasted or the result, and you can switch the counting off in the footer; see the privacy policy).

Report a problem or suggest an idea

Found a bug, or want this tool to do more? Tell us on the feedback page. No sign-up.

Other developer tools

JSON and data

Encoding, hashes and tokens

Generators

Time, numbers and colour

Text and code

Questions and answers

How do I turn & and angle brackets into HTML entities?

Choose "Encode" and type or paste; the result appears at once. Pick the level: basic (&, angle brackets and quotes), named entities (© é €), or every non-ASCII character as a number. "Decode" turns &copy; back.

Do I have to write Thai as entities?

No. If the page declares a UTF-8 charset, Thai and emoji can be written directly. The "every non-ASCII character as a number" level is for old systems without UTF-8 support, or HTML email.

Is it safe to paste a script tag, and is my text sent anywhere?

Yes: the result is shown as text and never put into the page as HTML. Decoding goes one level (&amp;lt; becomes &lt;) and knows the 252 standard HTML 4 names plus decimal and hex numbers. Nothing is sent anywhere.