URL Encode / Decode

Reserved · Sponsored728 × 90 · zero layout shift

What this tool does

Percent-encoding replaces characters that aren't safe in a URL with a % followed by their hex byte value, so query strings, path segments, and full links survive being copied, pasted, or transmitted without breaking. This tool covers both encoding scenarios browsers expose natively: component mode uses encodeURIComponent/decodeURIComponent for a single query parameter or path segment (escaping everything including &, ?, and /), while full-URL mode uses encodeURI/decodeURI for an entire URL, preserving structural characters like : // ? = & so the link stays a valid URL.

How to use

  1. 1
    Choose a scope

    Pick Component if you're encoding a single value that will sit inside a query string or path segment, or Full URL if you're encoding an entire link and want to keep its structure intact.

  2. 2
    Choose a direction

    Select Encode to percent-escape unsafe characters, or Decode to turn a percent-encoded string back into readable text.

  3. 3
    Paste your input

    Drop in a raw value or URL to encode, or a percent-encoded string to decode. The output updates immediately.

  4. 4
    Copy the result

    Use Copy to grab the converted string for your query string, redirect URL, or config file. Clear resets the input when you're done.

Use cases

  • Build a safe query string

    Encode a search term, email address, or free-text value in Component mode before appending it to a query string, so ampersands and equals signs inside it don't break the URL.

  • Debug a redirect URL

    Decode a percent-encoded redirect_uri or callback parameter pulled from server logs to see the actual destination URL a request was pointing at.

  • Share links with special characters

    Encode a full URL containing unicode text or spaces in Full URL mode so it can be pasted into emails, chat, or documents without getting mangled.

  • Inspect webhook or API payloads

    Decode percent-encoded values found in webhook bodies or API query parameters to verify your integration is sending exactly the data you expect.

FAQ

What's the difference between Component and Full URL mode?+

Component mode (encodeURIComponent) escapes almost every reserved character, including &, =, ?, and /, which is correct for a single query parameter value or path segment that might itself contain those characters. Full URL mode (encodeURI) leaves those structural characters alone since they're what make a URL a URL, only escaping characters that are genuinely unsafe within the URL as a whole, like spaces and unicode.

Why did encoding my whole URL with Component mode break it?+

encodeURIComponent escapes :, /, ?, and & — the very characters that separate a URL's protocol, host, path, and query string. Running an entire URL through it turns https://example.com/a?b=c into an unusable blob of %-codes. Use Full URL mode for whole links, and reserve Component mode for individual parameter values.

Why does decoding sometimes fail with an error?+

A malformed percent-encoded sequence — like a stray % not followed by two valid hex digits, or a truncated multi-byte UTF-8 sequence — will cause decodeURIComponent/decodeURI to throw a URIError. This tool surfaces that as a clear error instead of silently returning garbage.

Are spaces encoded as %20 or +?+

This tool uses the standard %20 for spaces, which is correct for URL paths and most contexts. The + convention for spaces is specific to application/x-www-form-urlencoded form bodies and query strings in that legacy format — if you need that behavior, replace %20 with + after encoding, or spaces with + before decoding.

Is my data sent anywhere?+

No. Encoding and decoding run entirely in your browser using the native encodeURIComponent, decodeURIComponent, encodeURI, and decodeURI functions. Nothing is uploaded or logged.

Related tools