HubTools

URL Encoder/Decoder

Encode and decode URLs online with support for both full URL and component encoding modes.

What is URL Encoding?

URL encoding (also called percent-encoding, defined in RFC 3986) is the standard mechanism for safely embedding arbitrary characters in a URL. The URL grammar reserves certain characters for structural roles — / separates path segments, ? starts the query string, & separates parameters, # introduces the fragment — so putting any of those into a parameter value, or using non-ASCII characters like accents and emoji, requires escaping them as %XX where XX is the hex byte value. JavaScript ships two encoders: encodeURI (for whole URLs, preserves structural characters) and encodeURIComponent (for parameter values, escapes everything reserved). Picking the wrong one is a classic bug source. This tool runs both modes locally with paste-and-decode for the reverse direction. Working with HTML special characters instead? Use the HTML Entity Converter. Encoding binary data? Try the Base64 Encoder/Decoder.
Text Input
0 B
Encoded Output
0 B
Encoding Statistics
Input Size
0 B
Output Size
0 B
Size Ratio
N/A
Mode
Encoding
About URL Encoding: URL encoding (also called percent-encoding) replaces characters that are not allowed in a URL with a % followed by two hex digits. Use Component mode (encodeURIComponent) to encode a single query parameter or path segment — it escapes reserved characters such as /, ?, &, and =. Use Full URL mode (encodeURI) when encoding a complete URL where those structural characters must remain intact.

How to use this tool

  1. 1
    Pick encode or decode
    Encode converts plain text into percent-encoded form. Decode reverses it. Pick the direction first.
  2. 2
    Choose encodeURI or encodeURIComponent (encode mode)
    Use encodeURI for full URLs you don't want corrupted. Use encodeURIComponent for individual parameter values.
  3. 3
    Paste your text
    Drop the URL or string into the input. The output updates in real time as you type.
  4. 4
    Copy the result
    Hit Copy to grab the encoded or decoded output for your code, browser address bar, or curl command.

Frequently asked questions

What's the difference between encodeURI and encodeURIComponent?
encodeURI preserves URL structure characters like /, ?, &, and # — use it on full URLs that you don't want corrupted. encodeURIComponent escapes all reserved characters including those — use it on individual query parameter values that may contain & or = (which would otherwise be misinterpreted as parameter separators by the URL parser).