URL Encoder/Decoder: Encode URLs and Query Parameters Online

Encode URLs and query parameters or decode URL-encoded strings with our free online tool. When building web addresses, certain characters (like spaces, ampersands, question marks, and special symbols) can break URLs or cause errors. URL encoding converts these problematic characters into a safe format that browsers and servers understand. For example, a space becomes %20 and an ampersand becomes %26.

Simply paste your text or URL to encode special characters for safe transmission, or decode a URL-encoded string back to readable text. Essential for working with query parameters in web addresses, API endpoints, form submissions, and search queries. See instant results as you type. Perfect for web developers and anyone working with URLs. All encoding happens locally in your browser.

What is URL Encoding?

URL encoding (also called percent encoding) is a mechanism for encoding information in a URL. URLs can only contain certain characters from the ASCII character set. Any character outside this set must be encoded using percent-encoding.

Common Use Cases:

  • Encoding query parameters in URLs
  • Passing data through GET requests
  • Working with REST APIs
  • Embedding special characters in URLs
  • Form data submission
  • OAuth and authentication flows

How URL Encoding Works:

Special characters are replaced with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code.

Common Encoded Characters:

Character URL Encoded
Space %20
! %21
# %23
$ %24
% %25
& %26
= %3D
? %3F

Example:

Original URL:

https://example.com/search?q=hello world&category=tools & tips

URL Encoded:

https://example.com/search?q=hello%20world&category=tools%20%26%20tips

Features:

  • Real-time encoding/decoding as you type
  • Support for all special characters
  • UTF-8 character support
  • Error handling for invalid input
  • One-click copy to clipboard
  • Paste button for quick input
  • 100% client-side - your data never leaves your browser

Important Notes:

  • encodeURIComponent vs encodeURI: This tool uses encodeURIComponent, which encodes all special characters. Use for query parameters and form data.
  • Reserved characters: Characters like /, ?, #, &, = have special meaning in URLs and are encoded.
  • + vs %20: Both represent spaces, but %20 is the standard encoding.

Frequently Asked Questions

What is URL encoding and why is it needed? +

URL encoding (also called percent-encoding) converts special characters into a format that can be safely transmitted in URLs. Characters like spaces, &, =, and non-ASCII characters have special meanings or aren't allowed in URLs. Encoding converts them to %XX format (e.g., space becomes %20) so they're transmitted correctly.

What's the difference between encodeURI and encodeURIComponent? +

encodeURI encodes a full URL, preserving characters like :, /, ?, and & that have meaning in URLs. encodeURIComponent encodes everything except letters, digits, and - _ . ~, making it safe for query parameter values. Use encodeURIComponent for data being passed as parameters.

Why do spaces sometimes become + and sometimes %20? +

Both represent spaces, but in different contexts. %20 is standard URL encoding. The + sign for spaces is specific to application/x-www-form-urlencoded format (HTML forms). Our tool uses %20 for general URL encoding, which is universally compatible.

How do I encode special characters in query strings? +

Characters like &, =, and ? have special meanings in query strings. When your data contains these characters, encode them: & becomes %26, = becomes %3D, ? becomes %3F. This prevents them from being interpreted as query string delimiters.

What characters don't need URL encoding? +

Unreserved characters are safe without encoding: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), and tilde (~). All other characters should be encoded when used in URL paths or query values to ensure proper transmission.