URL Encoder & Decoder Online

Encode and decode URL components, query parameters, and special characters for safe use in web addresses.

Runs in your browser. No data leaves your device.

About this tool

Percent-encodes or decodes text using JavaScript's encodeURIComponent and decodeURIComponent, live as you type. Meant for encoding query parameter values, path segments, and other URL components, or for reading an encoded string.

Features
  • Encode and Decode modes via a toggle; switching mode moves the result into the input
  • Live conversion on every keystroke
  • Non-ASCII text is encoded as UTF-8 %XX byte sequences
  • Shows "Invalid URL-encoded input" when decoding fails (for example a stray % not followed by two hex digits)
  • Copy and Pipeline buttons on the output; Clear button on the input
How to use it
  1. Choose Encode or Decode
  2. Type or paste text into the left box
  3. Copy the result from the right box
Inputs
  • Encode: any text (a single value or a whole URL)
  • Decode: percent-encoded text
Outputs
  • Percent-encoded text or decoded plain text
  • Copy to clipboard; send to another tool via Pipeline
Limits and notes
  • Encoding is always component-style (encodeURIComponent): the whole input is encoded, including :, /, ?, &, and =, so encoding a full URL makes it unusable as a URL; there is no encodeURI / full-URL mode
  • Characters left unencoded: A-Z a-z 0-9 - _ . ! ~ * ' ( )
  • Spaces encode as %20, not +; on decode, + is left as a literal + (no form-encoding mode)
  • Text containing unpaired surrogate characters fails to encode
  • Nothing is saved to localStorage; runs entirely in the browser with no upload

Frequently Asked Questions

How does the URL Encoder work?

Encoding uses JavaScript's encodeURIComponent(), which converts every character except A-Z, a-z, 0-9, and - _ . ! ~ * ' ( ) into its UTF-8 bytes written as %XX. Decoding uses decodeURIComponent() to reverse this. Because it is component-style encoding, characters like /, :, ?, and & are encoded too; there is no separate full-URL (encodeURI) mode.

What is URL encoding?

URL encoding replaces unsafe characters with percent-encoded equivalents (e.g., space becomes %20, & becomes %26). This ensures special characters in URLs are transmitted correctly by browsers and servers.

When do I need to URL encode?

Whenever you include user input, special characters, or non-ASCII text in URLs, query parameters, or form data. Common cases include building API URLs, generating links with parameters, and encoding file names.

What is the difference between encodeURI and encodeURIComponent?

encodeURI is meant for a full URL and leaves structural characters such as :, /, ?, &, =, and # intact. encodeURIComponent is meant for a single value and also encodes those characters, leaving only letters, digits, and - _ . ! ~ * ' ( ) unencoded. This tool uses encodeURIComponent, so it is best for query parameter values and path segments.