HTML Tools

Free URL Encoder and Decoder

A browser-based URL encoder and decoder. Convert text to percent-encoded format for safe inclusion in URLs, query parameters, and API requests. Supports two modes: encodeURIComponent (encodes all special characters for query values) and encodeURI (preserves URL structure characters like : / ? & =).

Loading tool...

What is URL Encoder and Decoder?

A browser-based URL encoder and decoder. Convert text to percent-encoded format for safe inclusion in URLs, query parameters, and API requests. Supports two modes: encodeURIComponent (encodes all special characters for query values) and encodeURI (preserves URL structure characters like : / ? & =).

quickAnswer

Encode or decode URL-encoded text with one click. Choose full encoding (encodeURIComponent) for query values or URL-safe (encodeURI) for complete URLs.

limitations

  • Does not handle non-UTF-8 character encodings — all input is assumed to be UTF-8 text.
  • Does not support batch encoding of multiple URLs — each input is processed individually.
  • Very long input strings (over 1MB) may be slow to encode in the browser.

How to use this tool

  1. Choose Encode or Decode direction.
  2. Select the encoding mode: Component (full) for query parameter values, or URI (safe) for complete URLs.
  3. Paste your text and copy the result.

What you can use it for

  • Encode special characters in query parameter values before appending them to a URL.
  • Decode a messy URL from browser address bar to see the original readable text.
  • Build UTM parameters for marketing links with proper encoding of spaces and special characters.

Use cases

Practical examples

example

Encode query parameter values

A developer builds a search URL with user input. They encode the search term 'hello world & more' to 'hello%20world%20%26%20more' using encodeURIComponent before adding it to the query string.

example

Decode a copied URL

A marketer copies a long URL with many percent-encoded characters. They paste it into the decoder and see the readable URL with actual spaces, ampersands, and special characters restored.

Common mistakes

  • Using encodeURI when encoding query parameter values — encodeURI preserves & and = which breaks query string parsing. Use encodeURIComponent for parameter values.
  • Double-encoding — encoding an already-encoded string produces garbled output like %25 for a percent sign.
  • Forgetting to encode the ? and # characters in user input used in URLs — these characters have special meaning in URL parsing.

verification

  1. Encode a string with spaces and special characters like 'hello world & test' and verify spaces become %20 and & becomes %26.
  2. Decode a percent-encoded string and verify all special characters are restored correctly.

FAQ

Questions about URL Encoder and Decoder

What is the difference between encodeURI and encodeURIComponent?

encodeURI is for encoding a complete URL — it preserves characters that have structural meaning like : / ? & = #. encodeURIComponent encodes EVERYTHING, including those structural characters. Use encodeURI for full URLs, encodeURIComponent for individual query parameter values.

Why do I see %20 in URLs?

%20 is the percent-encoded form of a space character. URLs cannot contain literal spaces, so spaces are encoded as %20 (or sometimes + in query strings). Other special characters like &, =, ?, and # are also percent-encoded to avoid being interpreted as URL syntax.

Related tools

More html tools

Html

ARIA Live Region Generator

Generate accessible ARIA live region HTML snippets with role, aria-live, aria-atomic, and aria-relevant attributes. Includes optional JavaScript update function.

Open tool

Html

CSP Hash Generator

Generate CSP hash values for inline scripts and styles. Hash exact code content with SHA-256, SHA-384, or SHA-512 and get the matching CSP directive snippet.

Open tool

Also try

Also try

Seo

AI Crawler robots.txt Builder

Build a robots.txt policy for AI crawlers. Choose from open, selective, or strict presets and block specific AI training bots while allowing search engines.

Open tool