URL Encoder/Decoder

Encode or decode URLs

Runs in your browser

Info

  • Standard (encodeURIComponent): Encodes all special characters, suitable for URL parameter values
  • Full URI (encodeURI): Preserves URL special characters like :, /, ?, &
  • Unsafe characters will be converted to %XX format (hex encoding)

What is URL encoding?

URL encoding, which RFC 3986 calls percent-encoding, replaces characters that are not allowed in a URL with a % sign and two hex digits for each byte of their UTF-8 form: a space becomes %20 and é becomes %C3%A9. This tool runs in your browser with JavaScript's encodeURIComponent (Standard, for a single value) and encodeURI (Full URI, which keeps characters such as : / ? # and & that give an address its structure). Decoding reverses either one.

Use cases

  • Encode a whole URL so it can travel as one query value, for example in a ?next= or redirect_uri parameter
  • Make a link with spaces or non-Latin text, such as a Vietnamese or Japanese page name, safe for an email, an HTML attribute or a sitemap
  • Decode a tracking link or an OAuth callback to read its parameters
  • Debug an API query string whose values contain &, = or #

When to use?

Use Standard for one value that goes inside a URL and Full URI for a complete address. Encode text only once: running encoded text through again turns every % into %25. Decoding treats + as a plus sign, so if the text came from an HTML form, replace + with spaces first; to carry arbitrary bytes, use Base64 instead.

Examples

  1. Encode a value for a query parameter (Standard)

    Input

    price=10€ & size=M

    Output

    price%3D10%E2%82%AC%20%26%20size%3DM

  2. Encode a full address (Full URI)

    Input

    https://example.com/search?q=café menu&page=2

    Output

    https://example.com/search?q=caf%C3%A9%20menu&page=2

  3. Decode an encoded URL

    Input

    %E1%BA%A3nh%20th%E1%BA%BB%202026

    Output

    ảnh thẻ 2026

Questions and answers

Should I use Standard or Full URI?

Use Standard for a single value you put inside a URL, such as a search term. Use Full URI for a complete address: it keeps characters like :, /, ? and & so the link still works.

Why is a space written as %20 and not +?

Percent-encoding writes a space as %20, which works everywhere in a URL. The + form is only used by HTML forms, and when decoding, a + stays a plus sign.

What does "Invalid data" mean when decoding?

The text contains a % that is not followed by two hexadecimal digits, for example "100%". Text like that needs to be encoded, not decoded.

Which characters are left unencoded?

Standard mode leaves letters, digits and - _ . ! ~ * ' ( ) unchanged. RFC 3986 treats only letters, digits and - . _ ~ as always safe, so encode the others yourself if a strict API needs it. Full URI also keeps reserved characters such as : / ? # & = and +.

Why do I see %2520 in my URL?

The text was encoded twice. The first pass turns a space into %20, and the second turns the % into %25, giving %2520. Decode it once to get back to %20, then use that single-encoded version.

Sources and standards

All Tools