URL Encoder
Encode text for URL query parameters.
Example
- In:
- hello world & foo=bar
- Out:
- hello%20world%20%26%20foo%3Dbar
Paste or type text, then click Encode.
Guide
Introduction
URLs are the addressing system of the web — but many characters are illegal or ambiguous in query strings, path segments, and fragment identifiers. Spaces become %20, ampersands in search terms break parameter parsing, and Unicode names require UTF-8 percent-encoding before they survive a round trip through analytics pipelines, REST clients, and form submissions. Getting encoding wrong causes 404s, split query parameters, and subtle bugs that only appear in production with international users.
Certoflow's URL Encoder converts strings and URI components into percent-encoded form entirely in your browser. Encode full URLs, individual query values, or path segments depending on your needs. Nothing transmits to Certoflow servers — encoded OAuth state parameters, internal route paths, and customer search terms stay local.
What this tool does
The encoder transforms text into URL-safe escaped sequences:
| Mode / use | Typical input | Output |
|---|---|---|
| Component encode | hello world | hello%20world |
| Full URI encode | Reserved chars in context | Selective encoding per RFC rules |
| Query value | Q&A session | Q%26A%20session |
| Unicode | café | UTF-8 bytes as %C3%A9 |
Standard toolbar: paste, copy result, example, clear. Validation catches empty input with guided empty states.
How it works
URL encoding (percent-encoding) replaces unsafe bytes with % followed by two hexadecimal digits representing the UTF-8 byte value.
JavaScript provides:
// Encode for query parameter values (RFC 3986 component)
encodeURIComponent('hello world');
// "hello%20world"
// Encode full URI while preserving structural characters
encodeURI('https://example.com/path?q=hello world');
// "https://example.com/path?q=hello%20world"
Certoflow applies the appropriate function or equivalent implementation client-side:
- Input → UTF-8 byte sequence for Unicode text.
- Escape → bytes outside unreserved set (
A-Za-z0-9-_.~) become%XX. - Output → copy-ready encoded string.
Unreserved characters (never encoded in components):
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 - _ . ~
Reserved characters (! * ' ( ) ; : @ & = + $ , / ? # [ ]) encode when they represent data, not delimiters — context matters.
No network requests. Encoding completes synchronously.
encodeURI vs encodeURIComponent
| Function | Encodes | Preserves |
|---|---|---|
encodeURI | Spaces, unicode in path/query content | ://, ?, &, = structure |
encodeURIComponent | Nearly all reserved chars | Nothing structural — for param values only |
Wrong choice breaks URLs:
// Wrong — encodes slashes in path
encodeURIComponent('users/123/profile');
// "users%2F123%2Fprofile"
// Right for path segment in isolation — encode each segment
encodeURIComponent('123');
// "123"
Real-world examples
Building a search API query
Base URL: https://api.example.com/search?q=
User query: node.js & npm
Encoded value: node.js%20%26%20npm
Full URL: https://api.example.com/search?q=node.js%20%26%20npm
OAuth 2.0 redirect URI registration
Redirect URI must match exactly including encoding:
https://app.example.com/callback?next=%2Fdashboard
Encode %2F for slash in next parameter value when constructing authorization URLs.
Analytics UTM parameters
Campaign name spring sale 2024 in utm_campaign:
utm_campaign=spring%20sale%202024
Verify encoding before pasting into Google Analytics URL builders.
Deep linking with Unicode
Product name 日本語マニュアル in path or query requires UTF-8 percent-encoding — %E6%97%A5%E6%9C%AC%E8%AA%9E... Verify round-trip with URL Decoder.
Form GET submission debugging
HTML forms with method="GET" encode fields automatically. When reconstructing URLs manually from server logs, encode each value to match browser behavior.
Webhook callback URL construction
Slack and Stripe accept callback URLs with query parameters. Encode API keys or state tokens placed in query values — never in paths without careful delimiter handling.
Common mistakes
Double encoding. Encoding an already-encoded string turns %20 into %2520. Decode first if unsure, then encode once.
Using encodeURIComponent on full URLs. Destroys ://, ?, and / structure. Use encodeURI for full URLs or encode components individually.
Encoding spaces as +. application/x-www-form-urlencoded uses + for spaces; RFC 3986 URI encoding uses %20. APIs differ — match consumer expectations.
Ignoring UTF-8 for non-ASCII. Latin-1 assumptions break on emoji and CJK characters. Always UTF-8 encode before percent-escaping.
Mixing path and query encoding rules. Slashes in path segments may or may not encode depending on server. Query values always need component encoding.
Leaving raw & and = in values. Q&A splits into multiple parameters unless encoded as Q%26A.
Assuming encoding equals encryption. Percent-encoding is reversible and offers no security. Secrets in URLs appear in logs — prefer POST bodies or headers.
Use cases
Frontend developers constructing fetch URLs, router links, and share buttons with dynamic user input.
Backend developers building redirect URLs, pagination links, and signed URL query strings.
QA engineers reproducing bug reports with exact encoded characters from production logs.
SEO specialists encoding non-ASCII slugs and hreflang query parameters correctly.
Technical writers documenting API examples with properly escaped sample URLs.
Students learning the difference between URI structure characters and data characters through hands-on encoding.
FAQ
Is my text sent to a server?
No. Encoding runs entirely in your browser.
Should I use encodeURI or encodeURIComponent?
encodeURIComponent for individual query values and form fields. encodeURI for full URLs needing structural characters preserved.
Why is my encoded output different from another tool?
Some tools encode more aggressively (parentheses, tilde). RFC compliance and context determine correct output — match your runtime (encodeURIComponent in JavaScript).
Does this encode spaces as plus signs?
Standard URI encoding uses %20. Form-urlencoded + is a separate convention — check your API spec.
Can I encode binary data?
URL encoding targets text bytes. For binary blobs, Base64 may be more appropriate in query strings.
How do I encode a full URL with many parameters?
Build base URL, then append ?, join key=${encodeURIComponent(value)} pairs with &.
Can I encode hash fragment identifiers?
Fragment encoding is rare; # typically delimits fragments. Encode fragment content carefully — servers often ignore fragments.
What's the maximum input length?
Browser memory limits apply. URLs themselves should stay under ~2000 characters for legacy IE compatibility; modern browsers tolerate more.
Can I use this offline?
Yes, after initial page load.
How do I verify encoding?
Paste output into Certoflow URL Decoder and confirm round-trip to original text.
Frequently Asked Questions
- encodeURIComponent vs encodeURI?
- This tool uses encodeURIComponent, which encodes more characters — correct for query parameter values.
- Does it encode spaces as %20?
- Yes. Spaces become %20 per standard percent-encoding.
Related Tools
Continue with these related utilities.
URL Decoder
Decode URL-encoded strings.
Developer ToolsBase64 Encode
Encode text to Base64 with UTF-8 support.
Developer ToolsHex Converter
Convert text, hex, and decimal in both directions.
Developer ToolsJSON Formatter & Validator
Format and validate JSON with one click.
Developer ToolsHTML Formatter
Indent and format HTML markup.