Advertisement
URL

URL Decoder / Encoder

Decode percent-encoded URLs and encode special characters. Parse URL components and query strings. Fast, free, real-time.

Advertisement

What Is URL Encoding (Percent Encoding)?

URL encoding — officially called percent-encoding — is a mechanism for representing characters in a URL that would otherwise be invalid or ambiguous. Because URLs can only contain a restricted set of ASCII characters, any character outside that set (spaces, unicode letters, special punctuation) must be replaced by a percent sign followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20, a question mark becomes %3F, and an ampersand becomes %26.

This tool decodes those sequences back to human-readable text and can also parse a full URL into its individual components — protocol, host, path, query parameters, and fragment — making it easy to inspect and debug complex URLs.

How to Decode a URL

Decoding a percent-encoded URL replaces each %XX sequence with the actual character it represents. For instance:

  • %20 → space
  • %3F?
  • %26&
  • %3D=
  • %2F/
  • %23#

Paste any encoded URL into the input above and the tool handles decoding instantly. If the input is a valid URL it will also break it apart into protocol, hostname, port, path, query string parameters, and fragment hash — each shown in a labelled row so you can inspect the structure at a glance.

URL Decoding in JavaScript

JavaScript provides two built-in functions. Use decodeURIComponent() to decode individual query values — it converts every %XX sequence including reserved characters like / ? # & =. Use decodeURI() for a complete URL when you want to preserve those reserved characters so the URL remains valid.

decodeURIComponent('hello%20world%3F')  // → "hello world?"
decodeURI('https://example.com/path%20name?q=hello%20world')
// → "https://example.com/path name?q=hello%20world"

URL Decoding in Python

Python's urllib.parse module handles percent-decoding with unquote(). For query strings, parse_qs() returns a dict of lists and parse_qsl() returns an ordered list of (key, value) tuples.

from urllib.parse import unquote, parse_qs

unquote('hello%20world%26more')  # → "hello world&more"

parse_qs('q=hello+world&lang=en')
# → {'q': ['hello world'], 'lang': ['en']}

URL Decoding in Java

Java's java.net.URLDecoder decodes application/x-www-form-urlencoded strings. Always specify the charset to avoid platform-dependent behaviour:

import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;

String decoded = URLDecoder.decode("hello+world%21", StandardCharsets.UTF_8);
// → "hello world!"

URL Decoding in C#

In .NET, Uri.UnescapeDataString() decodes percent-encoded sequences without touching + signs. HttpUtility.UrlDecode() (from System.Web) also converts + to space, matching form-encoding behaviour.

Uri.UnescapeDataString("hello%20world%3F")   // → "hello world?"
System.Web.HttpUtility.UrlDecode("hello+world%21")  // → "hello world!"

Common Encoded Characters Reference

Encoded Character Description
%20(space)Space character
%3A:Colon — used in protocol separators
%2F/Forward slash — path separator
%40@At sign — used in user info
%3F?Question mark — query string start
%26&Ampersand — query param separator
%3D=Equals sign — key/value separator
%23#Hash — fragment identifier
%25%Percent sign itself
%2B+Plus sign (also used for space in forms)

Related tools: URL Extractor, URL to Base64, Base64 Decoder

How to Use

  1. 1
    Paste the encoded URL — paste any percent-encoded URL or query string into the input field.
  2. 2
    Select mode — choose Decode to convert %XX sequences to readable characters, or Encode to escape special characters.
  3. 3
    View results — the decoded/encoded URL appears instantly, along with a structured breakdown of URL components and query parameters.
  4. 4
    Copy the result — use the Copy button or click individual component values to copy them.

Frequently Asked Questions

What does URL decoding do?

URL decoding converts percent-encoded characters back to their original form. For example, %20 becomes a space, %3F becomes ?, and %26 becomes &. This is necessary because URLs can only contain a limited set of safe ASCII characters — all others must be encoded before being transmitted.

How do I decode a URL in JavaScript?

Use decodeURIComponent() for query string values: decodeURIComponent('hello%20world') returns 'hello world'. Use decodeURI() for full URLs when you want to preserve reserved characters like / ? & =.

What is the difference between decodeURI and decodeURIComponent?

decodeURI() decodes a complete URL but leaves reserved URI characters intact. decodeURIComponent() decodes everything including those reserved characters — making it the right choice for individual query parameter values, but not for full URLs.

How do I decode a URL in Python?

Use urllib.parse.unquote(): unquote('hello%20world') returns 'hello world'. For query strings use urllib.parse.parse_qs() or parse_qsl() to get key-value pairs.

Why are spaces encoded as %20 or + in URLs?

URLs cannot contain literal spaces. In the path portion, spaces are encoded as %20 per RFC 3986. In query strings (application/x-www-form-urlencoded format), spaces are traditionally encoded as + — a legacy convention from HTML forms. Both are valid in their respective contexts.

How do I decode query string parameters?

Paste the full URL into this tool and enable the "Show URL component breakdown" checkbox. The tool will parse each query parameter into a key-value table automatically. In JavaScript, you can use new URLSearchParams(window.location.search) to iterate parameters.

What characters get percent-encoded in URLs?

Any character that is not an unreserved character (A-Z, a-z, 0-9, - _ . ~) must be percent-encoded in most URL contexts. Common encoded characters include: space (%20), slash (%2F), question mark (%3F), ampersand (%26), equals (%3D), hash (%23), at sign (%40), and percent itself (%25).

How do I URL-encode a string in JavaScript?

Use encodeURIComponent() to encode individual values like query parameter keys or values: encodeURIComponent('hello world & more') returns 'hello%20world%20%26%20more'. Use encodeURI() only for full URLs where you want to preserve the URL structure. Switch this tool to Encode mode to do it visually.

Comments

No comments yet. Be the first!