UTILYARD
tools / developer

URL Encoder / Decoder

Encode and decode URLs and URI components — supports percent encoding, encodeURI, and encodeURIComponent.

PLAIN TEXT
ENCODED URL
output appears here...

encodeURI vs encodeURIComponent

encodeURIComponent encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use this for query string values. encodeURI additionally preserves URL structure characters like / ? & = # :. Use this for full URLs.

FAQ

When should I use encodeURIComponent?
When encoding individual query parameter values. It encodes & and = which would break URL parsing.
When should I use encodeURI?
When encoding a full URL — it preserves the URL structure characters so the URL remains valid.
What is %20 vs +?
%20 represents a space in URLs. + is used in application/x-www-form-urlencoded (HTML form) encoding.

ABOUT THIS TOOL

Paste a URL or string to encode special characters into percent-encoded format, or decode an encoded URL back to readable text. URL encoding (percent-encoding) replaces characters outside the safe ASCII set — spaces, &, =, ?, non-Latin characters — with a % followed by their hex byte value, so a space becomes %20 and a colon becomes %3A, keeping URLs unambiguous for servers and browsers to parse. The tool distinguishes full encoding from component encoding, matching JavaScript's encodeURI versus encodeURIComponent behavior, since encoding a whole URL differs from encoding just a value going inside a query string. Handy when building query strings, sharing links with special characters, or debugging URL-related errors caused by unencoded input.

HOW TO USE

  1. Choose Encode or Decode mode.
  2. Paste the URL, query string, or plain text you want to convert.
  3. If encoding a value meant for a single query parameter, use component encoding rather than full URL encoding so characters like & and = still get escaped.
  4. Click convert and review the percent-encoded or decoded output.
  5. Copy the result and drop it into your query string, API call, or link.
  6. Decode any suspicious-looking %-prefixed string from a log or browser address bar to read it in plain text.

COMMON USE CASES

  • A developer building a search feature encodes a user's query text so spaces and special characters don't break the URL.
  • Someone sharing a link containing non-English characters or emoji encodes it so it pastes reliably into chat apps and emails.
  • A backend engineer decodes a redirect URL parameter from server logs to see exactly what value a client sent.
  • A developer debugging a broken API call notices an unencoded & inside a parameter value is truncating the request and fixes it by encoding.
  • A marketer building a UTM-tagged campaign URL encodes spaces and symbols in a campaign name so the link doesn't break when shared.

TIPS & COMMON MISTAKES

  • encodeURIComponent (component encoding) escapes more characters, including &, =, and ?, and is what you want for individual query parameter values; encodeURI (full encoding) leaves those characters alone because it assumes they're part of the URL structure.
  • Reserved characters like & and = have structural meaning in a URL — encoding them inside a value prevents them from being mistaken for a parameter separator.
  • Double-encoding is a common bug: encoding an already-encoded string turns "%20" into "%2520", so check whether your input is already percent-encoded before running it through again.
  • Unicode characters get encoded as multiple %XX sequences representing their UTF-8 bytes, so a single accented letter or emoji can expand into a longer percent-encoded string than you'd expect.

MORE QUESTIONS

What's the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL and preserves characters like :, /, ?, and & since they're structurally meaningful; encodeURIComponent encodes a single component (like a query value) and escapes those same characters because they'd otherwise be misread as URL structure.
Why did my URL break after encoding it twice?
Encoding an already-encoded string percent-encodes the % sign itself, turning "%20" into "%2520" — always decode first if you're unsure whether a string is already encoded.
Are all special characters encoded the same way across contexts?
Reserved-character conventions can differ — the classic application/x-www-form-urlencoded format used by HTML forms encodes spaces as +, while RFC 3986 percent-encoding used in URL paths uses %20.
Why does one emoji turn into a long string of % codes?
Percent-encoding operates on UTF-8 bytes, and characters outside basic ASCII (accented letters, emoji, CJK characters) take multiple bytes, each of which becomes its own %XX sequence.

RELATED GUIDES

What is URL Encoding?
Why URLs can only contain certain characters, how percent-encoding works, and when to use encodeURI vs. encodeURIComponent.
Read →
What is an API?
What APIs are, how REST works, what HTTP methods and status codes mean, and how to make a basic API request in JavaScript.
Read →
URL Encoder / Decoder — UtilYard