URL Encoding Behavior Across Languages & Frameworks (2025)
Not all percent-encoding is created equal. This static tool follows the exact same rules as JavaScript’s encodeURIComponent() — which has become the de facto web standard.
Quick Reference Table
- JavaScript → encodeURIComponent() ✓ (this tool)
- Python → urllib.parse.quote() ✓ (identical)
- Java → URLEncoder.encode(..., UTF-8) → space becomes + (different!)
- PHP → rawurlencode() ✓ (correct %20)
- Go → url.QueryEscape() ✓
- Ruby → CGI.escape → space becomes + (avoid)
Why JavaScript’s Behavior Wins
It uses %20 for space (not +), encodes * ' ( ) ! properly, and follows RFC 3986 exactly. Most modern APIs and CDNs expect this behavior.
Use This Tool as Your Golden Source
Whenever you’re unsure what a backend expects, paste the raw string here. The output is what browsers and most compliant libraries produce.
FAQ
Why does Java use + for space?
Legacy from form encoding. Use URLEncoder with StandardCharsets.UTF_8 + replace("+", "%20") to match web standard.
One tool, every language — instant consistency.