URL Encode / Decode Online - URL Encoder & Decoder + HTML Escape

A tool for encoding and decoding 6 types of string formats: URL, HTML, JSON, XML, JavaScript, and SQL.

How to Use

  1. Select an encoding type from the dropdown (URL / HTML / JSON / XML / JavaScript / SQL)
  2. For URL and HTML, sub-options are available (encodeURIComponent / encodeURI, Named / Numeric entities)
  3. Enter the text you want to encode or decode in the left text area
  4. Click 'Encode' or 'Decode' to see the result on the right
  5. Use the copy button to copy the result to your clipboard

Usage Examples

URL encode (encodeURIComponent):
Input: search keyword&type=1
Encoded: search%20keyword%26type%3D1
HTML escape (named entities):
Input: <script>alert("XSS")</script>
Escaped: &lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;
SQL single-quote escape:
Input: O'Brien
Escaped: O''Brien

FAQ

Is my data sent to a server?
No. All processing is done entirely within your browser.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes URL components (e.g., query parameter values). encodeURI encodes an entire URL, so structural characters like ://?=& are not encoded.
What is the difference between named and numeric HTML entities?
Named entities use readable names like &amp; and &lt;. Numeric entities use Unicode code points like &#38; and &#60;, and work for any character.
What does JSON encoding do?
It escapes characters with special meaning inside JSON string literals, such as newlines (\n), tabs (\t), backslashes (\\), and double quotes (\").
What if decoding fails?
Check that your input is in the correct encoded format. For URL decode, input must be percent-encoded. An error message will appear if the input is invalid.

Related Tools

Update History

Last Updated: 2026-02-20

  • 2026-02-20 Initial release