Skip to main content

URL Encoder & Decoder

Percent-encode and decode individual URL values

Input stays in this tab and clears when you reload or leave this tool.

Maximum input size: 65,536 UTF-16 code units.

Was this URL Encoder & Decoder helpful?

Help us keep tools reliable, fast, and bug-free.

What you can do with URL Encoder & Decoder

  • Encode url parameters
  • Decode percent encoded url

How this encoding and decoding works

Percent-encode text for use as an individual URL component, or decode a percent-encoded component back to readable text.

Example input

hello world&x=1

Example output

hello%20world%26x%3D1

Practical workflow

  1. Choose Encode or Decode.
  2. Paste one text value or its percent-encoded form; this tool processes a component, not a complete URL.
  3. Click the convert button, then Copy the result or Swap to reverse the conversion.

Common use cases

  • Encode a search term or a value containing spaces, ampersands, or slashes before putting it in a query parameter.
  • Decode a tracking link or redirect URL to see the real destination and parameters.
  • Read a percent-encoded value copied from server logs or an OAuth callback.

Important notes and limitations

  • Encoding uses encodeURIComponent, which escapes reserved characters including : / ? & and = — paste one parameter value, not a full URL you want to keep intact.
  • Decoding uses decodeURIComponent. A plus sign remains +; use %20 for a space and %2B for a literal plus when decoding component values.
  • Malformed percent escapes and percent-encoded bytes that are not valid UTF-8 show a readable inline error.
  • Encoding accepts up to 65,536 UTF-16 code units and produces at most 589,824 percent-encoded characters. Decoding accepts up to 589,824 input characters and limits decoded text to 65,536 code units, so encoded output can be decoded within the same bounds.
  • Conversion happens in your browser. Input and mode stay in tab memory and clear when you reload or leave the tool.

URL encoding, decoding & parsing terminal commands

URL-encode query string with Python urllib

python3 -c "import urllib.parse; print(urllib.parse.quote('hello world & key=1/2'))"

Percent-encodes spaces and reserved delimiter characters into standard ASCII %HEX sequences.

URL-decode string in bash

python3 -c "import urllib.parse; print(urllib.parse.unquote('%2Fapi%2Fv1%3Fquery%3Dtest%20search'))"

Converts percent-encoded hex entities back into standard UTF-8 readable text.

Parse URL components with Node.js WHATWG URL API

node -e "const u = new URL('https://user:[email protected]:8443/v1/items?page=2#section'); console.log(u)"

Deconstructs a URL string into origin, protocol, host, port, pathname, searchParams, and hash fragments.

URL malformed percent-encoding troubleshooting

URIError: URI malformed at decodeURIComponent

Cause: Encountering an isolated percent sign or an invalid UTF-8 byte sequence (e.g. '%E0%A4' with missing continuation bytes).

Solution: Sanitize lone percent signs ('%') to '%25' or wrap decoding in try/catch to safely fall back to raw text.

Double encoding (e.g. '%2520' instead of '%20')

Cause: Applying encodeURIComponent multiple times across API client wrappers or URL path concatenation.

Solution: Always construct URLs using the native 'new URL(path, base)' and 'searchParams.set()' APIs to prevent duplicate encoding.

Continue your workflow

  • Base64 Encoder & Decoder — encode UTF-8 text as standard Base64; arbitrary binary data may not decode as readable text.
  • HTML Entities Encoder — escape the same text for use inside HTML instead of a URL.
  • QR Code Generator — generate scannable mobile QR codes from encoded URLs and parameters.
  • OpenGraph Preview — Preview social media share cards and OpenGraph metadata generated for web URLs.

Frequently asked questions

What is the difference between %20 and + for a space?

This tool decodes URL components with decodeURIComponent, where + remains a plus sign. Use %20 to represent a space and %2B to represent a literal plus; form decoding has separate rules.

Should I encode a whole URL or just the parameter value?

Just the value. Encoding the whole URL turns https:// into https%3A%2F%2F and breaks it. Build the URL, then encode each dynamic value separately.

Why does decoding fail with a URIError?

The input contains a malformed percent escape or bytes that are not valid UTF-8. The inline error explains the problem; correct the escape or use a valid UTF-8 sequence and try again.

Focused guides for this tool

  • URL Encode & Decode Online — Encode special characters into percent-encoding or decode percent-encoded URLs back to readable text.