·5 min read·Blog

How to Encode and Decode URLs Online for Free (And Why It Matters)

URLs can only contain a limited set of characters. Everything else must be encoded. Here's what percent-encoding is, when you need it, and how to encode or decode any string free.

What URL encoding is

URLs are restricted to a small set of safe characters: letters (A–Z, a–z), digits (0–9), and a few symbols (- _ . ~). Every other character must be "percent-encoded" — replaced with a % sign followed by the two-character hexadecimal ASCII code.

Common examples:

  • Space → %20
  • & → %26
  • = → %3D
  • ? → %3F
  • / → %2F
  • # → %23
  • + → %2B

So a search query like hello world & more becomeshello%20world%20%26%20more when placed inside a URL parameter.

Encode and decode URLs free

Use the free URL encoder and decoder — paste any string to encode it for safe URL use, or paste an encoded URL to decode it back to readable form. No account, no upload.

When you need URL encoding

Query parameters

The most common case. When building a URL with user-supplied input in a query parameter, the value must be encoded:

https://example.com/search?q=hello world

becomes:

https://example.com/search?q=hello%20world

In most programming languages, the built-in URL or HTTP library handles this automatically. Problems arise when developers concatenate strings manually instead of using URL-building functions.

Internationalized domain names and paths

Non-ASCII characters in paths (accented letters, Cyrillic, Arabic, Chinese) must be encoded. A French URL likehttps://example.fr/catégorie becomeshttps://example.fr/cat%C3%A9gorie.

Decoding encoded URLs you receive

Encoded URLs from API responses, logs, or redirect parameters are hard to read at a glance. Paste them into the URL decoder to see the human-readable version.

Encoding vs encoding for forms (+)

There are two standards:

  • RFC 3986 (standard URL encoding): encodes spaces as %20. Used in URLs, HTTP headers, most modern APIs.
  • application/x-www-form-urlencoded: encodes spaces as +. Used in HTML form submissions (POST body). This is why some encoded URLs have + instead of %20 in form data.

When in doubt, use %20 — it is unambiguous and correct in all contexts. Use + only in form data where the server expects form encoding.

Security: why encoding matters

Failing to encode user input before inserting it into a URL is a source of security vulnerabilities. If a user types &admin=true and it is inserted raw into a query string, it could add an unintended parameter to the request.

Always use your language's URL-building library rather than string concatenation:

  • JavaScript: new URL() + searchParams.set(), or encodeURIComponent()
  • Python: urllib.parse.urlencode()
  • PHP: urlencode() or http_build_query()

Summary

URL encoding converts special characters to percent-encoded form so they can travel safely in URLs. Encode and decode any string with the free URL encoder. UseencodeURIComponent() in code when building URLs with user input. Spaces encode as %20 in standard URLs and + in form data.

Browse by category

Not sure which tool you need? Start with a category.

Everything you can do — for free

No software to buy. No account to create. Just open a tool and get it done.

Work with images

Compress photos before sending them by email, resize pictures for social media, remove backgrounds, or pick the perfect color for a design project — all without installing any app.

Edit and format text

Count words and characters in an essay, compare two documents side by side, convert text to different formats, or generate placeholder text for a presentation.

Stay safe online

Create a strong unique password in one click, check how secure a password is, encode or decode data, and generate secure tokens — your data never leaves your device.

Calculate anything

BMI, loan repayments, unit conversions, date differences, and dozens of other everyday calculations — no spreadsheet or formula knowledge required.

The Free AI Tools is a free collection of 221+ online tools that work directly in your web browser — no download, no installation, no account required. Whether you need to compress an image for email, count words in an essay, generate a strong password, create a QR code for your business, or format JSON for development — you will find a simple, free tool here.

Every tool is privacy-first: your files, text, and data never leave your device. Tools cover image editing, text processing, developer utilities, security & encoding, SEO & web, design & CSS, and more.

☕ Support Us