Blog
Wild & Free Tools

URL Encoding Cheat Sheet: Characters, Languages, and Quick Reference

Last updated: April 2026 5 min read
Quick Answer

Table of Contents

  1. Common Character Encodings
  2. Quick Syntax by Language
  3. Key Rules to Remember
  4. Frequently Asked Questions

This is the URL encoding reference you can bookmark and come back to. It covers the most common characters and their percent-codes, the right encoding function in each major language, and a few rules to keep in mind when building URLs programmatically.

Common Characters and Their Percent-Codes

CharacterNameEncodedNotes
SpaceSpace%20Or + in form encoding
!Exclamation%21Safe in some encoders
"Double quote%22
#Hash/pound%23Starts fragment if unencoded
%Percent%25Must encode to avoid double-encoding
&Ampersand%26Separates params if unencoded
'Apostrophe%27Safe in some encoders
(Open paren%28Safe in some encoders
)Close paren%29Safe in some encoders
+Plus%2BDecoded as space in form encoding
,Comma%2C
/Slash%2FSeparates path if unencoded
:Colon%3A
;Semicolon%3B
=Equals%3DSeparates key/value if unencoded
?Question mark%3FStarts query string if unencoded
@At sign%40Separates user info if unencoded
[Open bracket%5B
]Close bracket%5D

Always-safe characters (never need encoding): A–Z a–z 0–9 - _ . ~

Sell Custom Apparel — We Handle Printing & Free Shipping

Encoding Syntax in Every Major Language

LanguageFunctionSpace output
JavaScriptencodeURIComponent(str)%20
Pythonurllib.parse.quote(str, safe='')%20
Python (forms)urllib.parse.quote_plus(str)+
JavaURLEncoder.encode(str, UTF_8)+
C#Uri.EscapeDataString(str)%20
PHPrawurlencode($str)%20
PHP (forms)urlencode($str)+
RubyURI.encode_www_form_component(str)+
Gourl.QueryEscape(str)+
Bashpython3 -c "import urllib.parse; print(urllib.parse.quote('str'))"%20

Five Rules That Prevent Most URL Encoding Bugs

Encode Any Character — Free and Instant

Skip the lookup table. Paste any string into the Mongoose URL Encoder and get the percent-encoded result in one click.

Open URL Encoder

Frequently Asked Questions

What characters are safe to use in a URL without encoding?

Unreserved characters (RFC 3986): A–Z, a–z, 0–9, hyphen (-), underscore (_), period (.), tilde (~). These never need encoding anywhere in a URL.

Does URL encoding change the length of a string?

Yes, almost always longer. Each non-ASCII or reserved character becomes at least 3 characters (%XX). Emoji become 12 characters (%XX%XX%XX%XX). The encoded string can be several times longer than the original for international text.

Is there a maximum length for a URL?

There is no official maximum in the RFC specifications, but practical limits exist. Most browsers handle URLs up to ~2,000 characters. Many servers and CDNs reject URLs over 8,192 bytes. For very long parameter values, consider POST instead of GET.

Should I URL encode a full URL that I'm passing as a query parameter?

Yes — if the URL is a value inside another URL's query string, encode it completely including its slashes, colons, and question marks. encodeURIComponent() does this correctly. The outer URL structure remains intact; the inner URL becomes an opaque encoded value.

Ryan Callahan
Ryan Callahan Lead Software Engineer

Ryan architected the client-side processing engine that powers every tool on WildandFree — ensuring your files never leave your browser.

More articles by Ryan →
Launch Your Own Clothing Brand — No Inventory, No Risk