URL Encoder/Decoder
Turn text into safe URL encoding, or decode percent-encoded text back to normal. Bad input shows a clear error instead of crashing.
Open tool →Turn text into safe HTML entities, or turn entities back into plain text. Paste your code, pick a direction, and copy the result in one click.
Last updated: 17 November 2026.
Everything runs in your browser. Your text is never uploaded, sent, or stored.
HTML encoding is the process of replacing characters that have a special meaning in HTML with safe codes called entities. The most common ones are the less than sign, which becomes <, the greater than sign, which becomes >, and the ampersand, which becomes &. Browsers read those codes and display the original characters as plain text, instead of treating them as part of the page markup. That small change is what lets you show code on a web page without the browser trying to run it.
Decoding is the reverse step. It takes text that contains entities and turns the codes back into the original characters, so <div> becomes <div> again. Encoding and decoding are exact opposites, which means a round trip should give you back exactly what you started with. This tool does both directions, using the browser's own built in escaping, so the result always matches what a real browser would do.
The most common reason is showing code on a page. If you write a tutorial and want to show a reader a snippet such as <div class="box">, you cannot paste it raw into an HTML page, because the browser will treat it as a real div and hide the tags. Encoding it first turns the angle brackets into entities, so the reader sees the code exactly as you wrote it. The same applies to blog posts, help pages, and forum answers that include code samples.
Encoding also matters for safety. When a website displays text typed by a visitor, such as a comment or a username, encoding it first stops that text from being read as markup or script. A comment that contains a script tag stays harmless text instead of running in another visitor's browser. Developers call this escaping output, and it is one of the basic habits that keeps a website safe. Any time text moves from a person into a page, encoding is the step that keeps it plain text.
Start by choosing a direction at the top. Encode to HTML is the default, and it turns your text into entities. Decode from HTML does the reverse and turns entities back into plain characters. Paste your text into the top box, then press Convert. The result appears in the bottom box, ready to copy with the Copy result button. The counters above the boxes show how many characters went in, how many came out, and how many entities were changed, so you can see at a glance what the conversion did.
The swap button between the two boxes moves the output back into the input and flips the direction, which is handy for a round trip check. Paste encoded text, decode it, swap it, and encode it again: if the result matches the original, the round trip worked. The Load sample button fills in a small HTML snippet so you can try the tool before you paste your own text, and Clear empties both boxes. Nothing you paste leaves your browser at any point.
Decoding reads each entity and replaces it with the character it stands for. Named entities such as &, <, and > become an ampersand, a less than sign, and a greater than sign. Numbered entities work too, so < becomes a less than sign and < becomes the same character in hexadecimal form. Quotes become " when encoded and return to plain quotes when decoded, which keeps attribute values safe inside HTML tags.
One thing to watch is double encoding. If text has already been encoded once, encoding it again will turn the ampersand in < into &lt;, which displays as the literal text < instead of a less than sign. That is usually a sign that the same text was encoded twice by mistake. If your output shows entity names as visible text, decode once and check again before you encode. This tool decodes exactly one level at a time, so you can step through the process and see where the extra level came from.
A common mistake is encoding only part of a snippet. If you encode the opening tag but leave the closing tag raw, the browser will still read the raw part as markup and the page will break. Always encode the whole block at once, including every angle bracket and ampersand, and check the result in the preview before you publish. Another mistake is copying encoded text from a page that already shows it decoded, which pastes the raw characters instead of the entities you expected.
People also mix up HTML encoding with other kinds of encoding. A URL encoder handles percent codes in web addresses, which is a different job, and a Base64 encoder turns data into a plain text alphabet for transport, which is different again. HTML entities are only for making text safe inside HTML. Keep the three separate and each one does its own job well.
HTML encoding replaces characters that have a special meaning in HTML, such as <, >, and &, with safe codes called entities. The browser then shows those characters as plain text instead of reading them as part of the page markup.
The less than sign becomes <, the greater than sign becomes >, the ampersand becomes &, and double and single quotes become " and '. These five cover the characters that can change how a browser reads a page.
Decode when you have text full of entities and you want the original characters back, for example when you copy code from a web page and the tags show up as <div> instead of <div>. Decoding once restores the plain text.
No, as long as you encode the whole block and paste it where encoded text belongs, such as inside a code sample on a page. The browser shows the original characters to the reader, so the code looks exactly as you wrote it.
No. The conversion runs fully in your browser with plain JavaScript, using the browser's own escaping. Your text is never uploaded, never sent to a server, and never stored. You can close the page and nothing remains.