URL Encoder, Decoder, and Base64 Text Converter
Encode / DecodePercent encoding represents special characters in a URL component, while Base64 represents bytes using a restricted ASCII alphabet — they are often grouped together but solve different problems and are not interchangeable. The URL / Base64 Converter provides four operations: URL Encode, URL Decode, Base64 Encode (Text), and Base64 Decode (Text). Paste a string, choose a mode, convert it, and copy the output. All four transformations use native browser functions and process the value as text.
Convert URL or Base64 textQuick answer. Choose URL Encode for one query value or path segment containing spaces or special characters; URL Decode to turn valid percent escapes such as %20 back into characters; Base64 Encode (Text) to represent UTF-8 text using standard Base64; and Base64 Decode (Text) when standard Base64 is expected to decode into valid UTF-8 text. Base64 is not encryption, and this tool's Base64 mode is not a binary file converter or Base64URL decoder.
What is URL encoding?
URL encoding — often called percent encoding — represents a byte with a percent sign followed by two hexadecimal digits. A space encoded by this tool becomes %20, while characters outside the unescaped set are represented by their UTF-8 bytes:
Input: coffee & tea
Output: coffee%20%26%20tea
The ampersand must be encoded when it is data inside a query value; otherwise it can be interpreted as the separator before another parameter. This tool uses JavaScript's encodeURIComponent(), which is intended for a component, not an entire already-structured URL.
Encoding a query parameter vs. a whole URL
Select URL Encode, enter only the value that needs encoding, choose Convert Now, then place the result into the correct URL structure. A search value such as red shoes & socks becomes red%20shoes%20%26%20socks and can be inserted as a parameter:
https://example.com/search?q=red%20shoes%20%26%20socks
encodeURIComponent() also encodes structural delimiters such as :, /, ?, =, and &. Encoding the complete URL https://example.com/search?q=blue produces something like:
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dblue
That is useful only when the whole URL must become a value inside another context; it is not directly navigable as the same URL. Encode individual dynamic components while preserving the URL's intended structure, and prefer a URL API or framework utility over manually concatenating untrusted strings.
Characters left unescaped
encodeURIComponent() leaves ASCII letters, digits, and this set unescaped:
- _ . ! ~ * ' ( )
Other characters are converted to percent escapes based on UTF-8. Standards or signing protocols can require stricter canonical encoding than JavaScript's default, so for OAuth signatures, cloud API signing, or another specification, follow its exact normalization rules rather than assuming any general URL encoder is sufficient. Hexadecimal digits in percent escapes may appear uppercase or lowercase and still represent the same byte in ordinary URL processing, although signature systems can require a canonical representation.
URL decoding and the plus-sign rule
Select URL Decode and paste a percent-encoded component. The decoder uses decodeURIComponent() and expects complete, valid percent-encoded UTF-8 sequences:
Input: M%C3%BCnchen%20caf%C3%A9
Output: München café
A stray %, an incomplete escape such as %2, or bytes that do not form valid UTF-8 produce an error in the output. Note that HTML form encoding commonly represents spaces as + in application/x-www-form-urlencoded data, but decodeURIComponent() does not apply that rule — red+shoes decodes to red+shoes. If you are decoding a form query component, convert + to a space according to the form specification first, or use a proper query-string parser; do not blindly replace plus signs when + is legitimate data. Likewise, URL Encode produces %20 for a space rather than +.
Avoiding double URL encoding
Encoding an already-encoded value changes percent signs into %25:
Original: red shoes
Encoded once: red%20shoes
Encoded twice: red%2520shoes
One decode of the double-encoded string produces red%20shoes, not red shoes. Double encoding is a common source of broken redirects, failed API signatures, and security-filter inconsistencies. Define which layer owns encoding and encode exactly once for that context.
Encoding and decoding Base64 text
Base64 converts bytes into characters from an ASCII alphabet — uppercase and lowercase letters, digits, +, and /, with = used as padding when required — and it is reversible representation, not secrecy. Select Base64 Encode (Text) to represent text; the implementation first converts the JavaScript string to UTF-8 bytes and then calls the browser's Base64 encoder, so ordinary Unicode such as accented characters and emoji work when they form valid strings:
Input: Hello
Output: SGVsbG8=
Select Base64 Decode (Text) to reverse standard Base64. The browser decodes it into bytes and then interprets those bytes as UTF-8, so if the bytes represent an image, archive, or text in another encoding, UTF-8 conversion can fail or produce incorrect characters — use a binary/file Base64 tool for non-text data. The output uses standard Base64, including +, /, and any required = padding.
Standard Base64 vs. Base64URL
| Standard Base64 | Base64URL |
|---|---|
Uses + | Uses - |
Uses / | Uses _ |
Often includes = padding | Padding is often omitted |
Base64URL is a URL-safe variant used by JWTs and web protocols. The tool's Base64 modes use standard Base64: they do not translate the URL-safe alphabet or automatically restore omitted padding. A JWT segment is Base64URL, so use the JWT Decoder or a dedicated Base64URL implementation rather than assuming standard decoding will work.
Base64 is not compression, encryption, or hashing
Base64 normally increases size: every three input bytes become four Base64 characters, plus possible padding — roughly a 33% increase before surrounding formatting. Repetition can compress well later under gzip or Brotli, but Base64 itself is encoding, not compression. Embedding small resources can reduce network requests in some contexts, yet large Base64 blobs increase document size, memory use, and parsing overhead.
| Operation | Reversible? | Requires a key? | Purpose |
|---|---|---|---|
| Base64 encoding | Yes | No | Represent bytes as ASCII text |
| URL encoding | Yes | No | Represent characters safely in URL components |
| Encryption | Yes, with the proper key | Yes | Protect confidentiality |
| Hashing | Designed as one-way | No for plain hashes | Create a fingerprint or integrity value |
Do not place a password, API token, or private key into Base64 and assume it is protected. Base64 strings are recognizable and trivial to decode.
Unicode and malformed-text edge cases
The Base64 implementation uses a traditional encodeURIComponent/unescape bridge for UTF-8 encoding and the reverse bridge when decoding. It handles normal Unicode text but can throw for malformed JavaScript strings containing an isolated surrogate code unit. A decoded byte stream must also be valid UTF-8: standard Base64 can represent any bytes, but this specific mode only returns text, so if you need robust byte-level conversion, use TextEncoder, TextDecoder, typed arrays, and file APIs in application code.
URL decoding also requires valid UTF-8 percent sequences. Legacy sites sometimes percent-encode bytes in a local character set rather than UTF-8, and a modern component decoder may reject or misinterpret them.
Common errors and fixes
URI malformed
The URL input contains an incomplete percent escape, invalid UTF-8 byte sequence, or malformed Unicode string. Correct the source rather than repeatedly decoding.
Base64 input is rejected
Check the alphabet, padding, accidental spaces, line breaks, and whether the input is actually Base64URL. Do not guess padding for a protocol without reading its specification.
Decoded Base64 shows an error
The decoded bytes may be binary or may use a text encoding other than UTF-8. Use a binary-aware decoder.
Spaces decode incorrectly
Form data may use + for space, while this component decoder leaves plus signs unchanged. Use a form/query parser.
A complete URL becomes unusable after encoding
Encode only its dynamic path or query components, not structural delimiters.
Output contains %25
The percent sign from an existing escape was encoded again. Investigate double encoding.
Security considerations
Encoding does not make unsafe content safe in every context. URL encoding is not an HTML sanitizer, SQL parameterizer, shell escaper, or authorization check — the correct transformation depends on where data is inserted. Use parameterized queries for SQL, safe DOM/text APIs for HTML output, an allowlist for redirect destinations, and apply canonicalization consistently before security comparisons. Avoid executing decoded content, and do not trust a value merely because it was encoded.
Base64 can hide malicious bytes from casual inspection but does not neutralize them. Decode untrusted data only within appropriate size and content limits.
Privacy and browser-based processing
The four operations run through native JavaScript functions in the browser and do not require an encoding API call. Even so, avoid pasting live credentials or confidential personal data, because clipboard history, browser extensions, screen capture, and a compromised device can expose text regardless of where conversion runs.
The tool handles pasted text only. It does not upload files, create downloads, generate data URLs, or convert images despite broader Base64 use cases.
Frequently asked questions
Which operations are supported?
URL Encode, URL Decode, Base64 Encode (Text), and Base64 Decode (Text).
Does URL Encode handle an entire URL?
It uses encodeURIComponent, which encodes URL delimiters. Usually you should encode individual values or path segments.
Does URL Decode convert plus signs to spaces?
No. decodeURIComponent leaves + unchanged; plus-to-space is part of form/query decoding.
Does Base64 mode support Unicode?
It converts normal JavaScript text through UTF-8, so ordinary Unicode text is supported.
Can it decode images or files from Base64?
No. This mode expects decoded bytes to be UTF-8 text and has no binary file output.
Does it support Base64URL?
No. The output and input use standard Base64 syntax.
Is Base64 encrypted?
No. Anyone can reverse it without a key.
Why does Base64 end with =?
Padding completes the final four-character group when the byte length is not divisible by three.
Can URL encoding prevent XSS or SQL injection?
Not generally. Use the security mechanism appropriate to the destination context.
Can I copy the output?
Yes. After converting, use the Copy action. The tool does not download an output file.
Related tools
JWT Decoder
Inspect Base64URL-encoded JWT sections.
Image to Base64
Convert an uploaded image into a data URI.
Hash Generator
Create one-way fingerprints rather than reversible encoding.
Related guides
QR Code Generator Guide
Generate high-quality custom QR Codes for any URL, text, or phone number instantly.
Word & Character Counter Guide
Live-updates word, character, and paragraph counts plus a reading-time estimate.
JSON Formatter / Validator Guide
Format, validate, beautify, and minify raw JSON string data dynamically.
Encode or decode text
Paste a string, choose URL Encode, URL Decode, Base64 Encode, or Base64 Decode, and copy the result.
Use URL / Base64 Converter