HomeDevURL Decoder & Encoder
Web tools

URL Decoder & Encoder

Use the free URL Decoder & Encoder on CalculatorX for fast local results. Clear formulas, assumptions, and worked examples on the page. Try it free.

Loading tool…

Loading Preparing tool…

How to use

Follow these steps for a clear answer.

1

Enter a URL or string

Paste the text you want to encode or decode.

2

Encode or decode

Pick the direction that matches your task.

3

Copy safely

Click Copy next to Result for use in links, redirects, or APIs.

URL encoder / decoder specification

Version 1.0.0 · Last reviewed 2026-07-28

Definition
URL encoding (percent-encoding) converts reserved and non-ASCII characters to %XX hex form so they can safely appear in URLs and query strings.
What it calculates
Percent-encode and decode text using the same rules as JavaScript encodeURIComponent / decodeURIComponent.
Inputs
  • Plain text or percent-encoded string
  • Mode: encode or decode
Outputs
  • Percent-encoded string (encode) or decoded text (decode)
Formula
encodeURIComponent(text) · decodeURIComponent(text)

URL encoding (percent-encoding) converts special characters in URLs to %XX hex format. Browsers encode URLs automatically; developers encode manually when building query strings, mailto links, and API requests.

Encoding example

Original URL:

https://www.example.com/dev/url-decoder-encoder

Encoded URL:

https%3A%2F%2Fwww.example.com%2Fweb%2Ftools%2Furl-decoder-encoder

Common encoded characters

Character Encoded Name
(space) %20 Space
! %21 Exclamation
# %23 Hash
$ %24 Dollar
& %26 Ampersand
+ %2B Plus
/ %2F Slash
: %3A Colon
= %3D Equals
? %3F Question mark
@ %40 At sign

When to encode URLs

  • mailto links — encode spaces and special chars in subject/body (see HTML Link Code Generator)
  • Query parameters — encode values with spaces or symbols
  • API requests — encode user input before sending
  • Form submissions — GET method encodes automatically

JavaScript encoding

// Encode a component (for query values)
encodeURIComponent("hello world");  // "hello%20world"

// Encode a full URI (preserves :// and /)
encodeURI("https://example.com/path?q=hello world");

Decoding

decodeURIComponent("hello%20world");  // "hello world"
Assumptions
  • Uses encodeURIComponent / decodeURIComponent (not form-urlencoded + for space).
  • Conversion runs locally in the browser; nothing is uploaded.
Units
  • Input/output: text strings
Boundary conditions
  • Empty input yields an empty result.
  • Malformed % sequences may throw on decode.
Example
"hello world" → hello%20world
Validation cases
  • "hello world" encode → hello%20world
  • example.com URL encode → https%3A%2F%2Fwww.example.com%2Fweb%2Ftools%2Furl-decoder-encoder
  • hello%20world decode → hello world
  • "a&b=c" encode → a%26b%3Dc
Sources
  • RFC 3986 percent-encoding
  • ECMAScript encodeURIComponent / decodeURIComponent
Last reviewed
2026-07-28
Calculation version
1.0.0

Frequently asked questions

Key distinctions behind the tool.

Space: %20 or +?

In query strings, spaces can be %20 or +. In URL paths, use %20. %20 is always safe.

Should I encode the entire URL?

Encode individual components (query values, path segments), not the entire URL structure (://, / between segments).

Is URL encoding the same as Base64?

No. URL encoding uses %XX for special characters. Base64 encodes binary data as ASCII text.

When do browsers encode automatically?

Browsers encode URLs when you click links or submit forms. Manual encoding is needed when building URLs in code.