nicetool.dev logo

URL ENCODER

Everything is processed in your browser. Your data never leaves your computer.

Input String
Result

What is URL Encoding?

URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It ensures that all characters in a URL are from the limited set of ASCII characters allowed in URIs.

Why Encode URLs?

URLs can only be sent over the Internet using the ASCII character-set. Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format. URL encoding replaces unsafe ASCII characters with a '%' followed by two hexadecimal digits.

  • / Used as a delimiter to separate path segments.
  • ? Used to separate the path from the query string.
  • # Used to separate the main URL from a fragment identifier.
  • & Used to separate parameters in a query string.
  • Spaces are not allowed in URLs and are often encoded as '+' or '%20'.

How It Works

URL encoding replaces reserved, unprintable, or non-ASCII characters with a percent sign (%) followed by a two-digit hexadecimal representation of the character's ASCII code.

The string 'hello world' becomes 'hello%20world'

How to use the URL Encoder/Decoder

  1. 1

    Pick Encode to make text safe for a URL, or Decode to turn percent-encoded text such as %20 back into readable characters.

  2. 2

    Paste a full URL, a query string value or any text into the input box.

  3. 3

    The result appears immediately. Spaces become %20, non-ASCII letters become their UTF-8 bytes (é becomes %C3%A9) and reserved characters like & and = are escaped.

  4. 4

    Copy the output and use it in your link, API request, redirect or analytics parameter. Switch modes to check the reverse direction.

Practical examples

Query string values

A search for "coffee & tea" must be sent as q=coffee%20%26%20tea, otherwise the & starts a new parameter and the server only sees "coffee ".

Reading tracking links

Marketing and redirect URLs often contain an encoded URL inside another URL. Decoding shows the real destination before you click it.

Non-English URLs

A Vietnamese or Japanese path is stored by browsers in percent-encoded form. Decoding https://example.com/s%C3%A1ch shows the readable path "/sách".

OAuth and redirect URIs

The redirect_uri parameter must be fully encoded. Encoding it here avoids "redirect_uri mismatch" errors caused by a stray ? or /.

Frequently asked questions

What is URL encoding?+

Also called percent-encoding (RFC 3986), it replaces characters that are not allowed or have a special meaning in URLs with a % followed by two hexadecimal digits for each byte.

Should spaces be %20 or +?+

%20 is valid everywhere in a URL. The + sign only means a space inside form data (application/x-www-form-urlencoded) query strings, so %20 is the safer choice.

What is the difference between encodeURI and encodeURIComponent?+

encodeURI keeps characters that structure a URL, such as / ? & and =, so it is meant for whole URLs. encodeURIComponent escapes them too and is meant for a single parameter value.

Why did decoding fail?+

The input contains a % that is not followed by two valid hex digits, or a byte sequence that is not valid UTF-8. Check that the string was not cut off or double-encoded.