New: ๐ŸŽจ Pixart POD Bundle โ€” 155 AI designs + 7 digital productsยทMore free tools by Noah AI Labs โ†’

URL Encoder Decoder

Free online tool to encode and decode URLs instantly. Percent-encode special characters for safe URL transmission.

0 characters
0 characters

encodeURIComponent vs encodeURI

encodeURIComponent

Encodes all special characters including : / ? # [ ] @ ! $ & ( ) * + , ; =

Use for: Query parameters, path segments, form data

hello world! โ†’ hello%20world%21

encodeURI

Preserves URL structure characters like : / ? # @ !

Use for: Complete URLs where you want to keep the structure

https://example.com/path?q=hello world โ†’ https://example.com/path?q=hello%20world

What is URL Encoding?

URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It converts characters that are not allowed in URLs or have special meanings into a format that can be safely transmitted over the internet.

Special characters are replaced with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII value. For example, a space becomes %20, and an exclamation mark becomes %21.

Characters That Need Encoding

  • Space - Encoded as %20 or + (in form data)
  • Reserved characters - ! # $ & ( ) * + , / : ; = ? @ [ ]
  • Unsafe characters - < > % | \ ^ ~ ` "
  • Non-ASCII characters - Unicode characters like Japanese, emoji, etc.

Common Use Cases

  • Passing data in URL query parameters
  • Creating SEO-friendly URLs with special characters
  • Encoding form data for HTTP requests
  • Handling internationalized domain names (IDN)
  • Building API requests with dynamic parameters

Frequently Asked Questions

What is the difference between URL encoding and percent encoding?

URL encoding and percent encoding are the same thing. The term "percent encoding" comes from the use of the percent sign (%) followed by hexadecimal values to represent special characters. Both terms refer to the RFC 3986 standard for encoding URIs.

Why do spaces become %20 in URLs?

Spaces are not valid characters in URLs according to RFC 3986. The character "%20" represents the hexadecimal value (20) of the ASCII code for a space (decimal 32). In HTML form submissions, spaces may also be encoded as "+" signs, but %20 is the standard for URLs.

When should I use encodeURIComponent vs encodeURI?

Use encodeURIComponent when encoding individual URL components like query parameters or path segments. Use encodeURI when you want to encode a complete URL while preserving the URL structure (slashes, colons, etc.).

Is URL encoding the same as Base64 encoding?

No, they are different encoding schemes. URL encoding (percent encoding) is specifically designed for safe URL transmission, converting special characters to %XX format. Base64 encoding converts binary data to ASCII text using 64 characters and is used for embedding binary data in text formats.

Why is my decoded URL showing an error?

Decoding errors typically occur when the input contains invalid percent-encoded sequences. A valid sequence must be a percent sign followed by exactly two hexadecimal digits (0-9, A-F). For example, "%2G" is invalid because "G" is not a hexadecimal digit.

Is my data safe when using this tool?

Yes, absolutely. All encoding and decoding operations happen entirely in your browser using JavaScript. Your data is never sent to any server. You can even use this tool offline once the page has loaded.

How do I encode non-English characters like Japanese or emoji?

Non-ASCII characters are first converted to their UTF-8 byte representation, then each byte is percent-encoded. For example, the Japanese character "ใ‚" becomes "%E3%81%82" (three UTF-8 bytes, each encoded). This tool handles UTF-8 encoding automatically.

๐Ÿ”’

100% Private

All processing happens in your browser. Your data never leaves your device.

โšก

Real-Time

See results instantly as you type. No need to click a button to encode or decode.

๐ŸŒ

Works Offline

Once loaded, the tool works without an internet connection.