URL Encoder & Decoder – Encode and Decode URLs | TempScript
100% browser-based • Native JS only

URL Encoder & Decoder

Encode and decode URLs and their components instantly in your browser, inspect query strings parameter by parameter, and see detailed errors when something is not valid percent-encoding. No sign-up, no tracking, no data sent to a server.

URL encoder and decoder tool

Private by design. All encoding and decoding run locally using the native encodeURIComponent(), decodeURIComponent(), encodeURI() and decodeURI() functions. Your URLs are never uploaded, stored, or logged.

Encodes reserved characters like &, =, ? and /. Best for a single query value or a search term.

Input 0 chars 0 lines
Output 0 chars 0 B
Status: Waiting for input Percent-escapes in input: 0 Mode: Component
Query string inspector —
Paste a URL that contains a ? to inspect its parameters.
URL encoder and decoder tool with two panels for input and output
Encode and decode URLs, then inspect query parameters side by side.

How to use the URL encoder and decoder

  1. Choose a mode. Pick Component for a single value or search term, or Full URL to encode or decode an entire address.
  2. Paste your input. Type or paste a URL, a component or a percent-encoded string into the left panel. Or click one of the examples.
  3. Click Encode or Decode. The result appears in the right panel. Encode converts reserved characters to %XX escapes; Decode turns them back into their original characters.
  4. Inspect the query string. If your input is a URL with a ? in it, the query inspector below the panes breaks it into individual parameters.
  5. Copy or swap. Use Copy output to put the result on your clipboard, or Swap to copy the output back into the input panel for a second pass.

Key features and benefits

Component encoding

Encode or decode a single value with encodeURIComponent / decodeURIComponent.

Full URL encoding

Use encodeURI / decodeURI to work with a complete URL while preserving its structure.

Query-string inspector

Break any URL into its individual parameters with decoded and raw values shown side by side.

Detailed error messages

Invalid percent-encoding produces a clear error instead of silently returning broken output.

Fully private

Everything runs in your browser with native JavaScript functions. Nothing is transmitted or logged.

Responsive layout

Side-by-side panels on desktop, stacked panels on mobile — comfortable on any screen size.

Privacy and limitations

  • Fully client-side. Every operation runs in your browser using native functions. No URL is ever uploaded, stored, or logged.
  • No tracking of content. The tool does not record what you paste. There is no analytics on the input or the output.
  • Shared computers. Avoid pasting URLs that contain secret tokens or credentials on a shared machine. Use Clear when you are done.
  • Strict decoding. decodeURIComponent() rejects malformed percent-escapes. The tool reports the error rather than silently returning a corrupted string.
  • No automatic saving. Content is not persisted between visits. Reloading the page clears both panels.

Frequently asked questions

What is URL encoding?
URL encoding (also called percent-encoding) replaces characters that are not allowed in a URL with a percent sign followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand inside a query value becomes %26.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes a single piece of a URL, like a query value, and will encode reserved characters such as &, =, ? and /. encodeURI encodes a whole URL and preserves those reserved characters because they are meaningful in the URL's structure.
Is this URL encoder safe to use?
Yes. Everything runs in your browser using native JavaScript. Your URLs are never uploaded, stored, or logged on any server.
Why does decoding sometimes fail?
decodeURIComponent throws an error when it encounters a percent sign that is not followed by two valid hexadecimal digits, or when a percent-encoded byte sequence is not valid UTF-8. The tool shows a clear error message in that case.
When should I encode a full URL versus a component?
Encode a full URL when you want to pass a complete address as a value inside another URL or as a query parameter. Encode a component when you only need to encode one piece, like a search term or a single parameter value, and want all reserved characters encoded.
Does encoding change the meaning of my URL?
No. Encoding is a reversible transformation. After decoding, you get the original string back unchanged. The encoded form is simply a safe representation that can be transmitted without ambiguity.

A practical guide to URL encoding and query strings

URLs were designed to carry a limited set of characters — mostly letters, digits and a handful of punctuation. Anything outside that set, including spaces, non-Latin scripts and many symbols, must be represented in a form the protocol understands. That representation is called percent-encoding, and it is the reason you see sequences like %20 and %C3%A9 in links.

What gets encoded, and why

Percent-encoding converts a character into one or more bytes (usually UTF-8), then writes each byte as a percent sign followed by two hexadecimal digits. A space becomes %20. An accented "é" becomes %C3%A9. An ampersand inside a query value becomes %26, which is essential because an unescaped & would otherwise be interpreted as the start of a new parameter. The same reasoning applies to =, ?, # and other characters that have structural meaning in a URL.

Component vs. full-URL encoding

JavaScript gives us two pairs of functions:

  • encodeURIComponent / decodeURIComponent — treats the string as a single piece. It will encode &, =, ?, /, # and other reserved characters, because inside a component those characters have no structural role. Use this for query values, form fields and path segments.
  • encodeURI / decodeURI — treats the string as an entire URL. It preserves &, =, ?, /, : and other characters that have meaning in the URL's structure. Use this when you want to normalize a full address without breaking its parts.

Choosing the wrong one is the most common source of encoding bugs. If you encode a full URL with encodeURIComponent, the resulting string is unusable as a URL. If you encode a query value with encodeURI, an & inside the value will leak out and split the parameter in two.

Query strings, parameter by parameter

A query string starts after the first ? and consists of key-value pairs separated by &. Each pair is usually key=value, though a bare key with no = is also valid. Values are typically percent-encoded, and the same key can appear more than once — a common pattern for multi-select filters. The query inspector in this tool decodes each value separately so you can see exactly what the server will receive, while keeping the raw form visible for comparison.

Common pitfalls

  • Double encoding. Encoding an already-encoded value produces sequences like %2520 (which decodes back to %20, not a space). Decode first if you are unsure.
  • Spaces as plus signs. In application/x-www-form-urlencoded bodies, a space is represented as +. In URLs proper, a space should be %20. The two are not interchangeable in every context.
  • Truncated escapes. A percent sign at the end of a string, or one followed by fewer than two hex digits, is invalid and will cause decodeURIComponent to throw.
  • Mixing UTF-8 and legacy encodings. Modern URLs expect UTF-8 bytes. Older systems may emit Latin-1 escapes that look similar but decode to different characters.

About this tool

This URL encoder is part of the TempScript free online tools collection. It runs entirely in your browser, requires no account, and never sends your data anywhere. If you work with URLs and query strings regularly, you may also find our JSON formatter and text case converter useful for quick formatting tasks.

© 2026 TempScript. All rights reserved.