Base64, URL encoding and JSON escaping solve different problems
Choose an encoding by its destination and avoid accidental double encoding.
Identify the boundary first
Ask what the next system expects. A URL parameter needs percent encoding; a JSON string needs JSON escaping; a protocol field may ask for Base64 bytes. These formats are not interchangeable, even when they all turn punctuation into another representation. None of these operations makes a secret safe to publish.
Encode a URL component, not its whole structure
For the search value cats & dogs, URL Encode returns cats%20%26%20dogs. The encoded ampersand belongs to the value, while the literal ampersand between two query parameters separates them. If you encode the entire URL, its structural slashes and question mark change too. If you encode the already encoded value again, %20 becomes %2520. Keep track of whether the component is raw or encoded at each boundary.
Base64 represents bytes
The UTF-8 text Hello becomes SGVsbG8=. Anyone can decode it without a key. Standard Base64 and URL-safe Base64 have different alphabets and padding conventions. This site encodes text and decodes standard Base64 as UTF-8; it is not an image or binary file decoder. A decoding failure can mean the bytes are not UTF-8 even when the Base64 itself is legitimate.
JSON still needs its own syntax
Putting an encoded value inside a JSON request does not remove JSON syntax rules. Strings need double quotes, embedded quotation marks need escaping and trailing commas are invalid. Use a serializer in application code, then validate a sample here when debugging. Treat decoded output as untrusted data and never execute it merely because decoding succeeded. When investigating a problem, preserve a harmless original example and apply one transformation at a time so the failing boundary is visible.
Try the workflow
- Base64 Encode — Encode Unicode text as Base64.
- Base64 Decode — Decode Base64 back into UTF-8 text.
- URL Encode — Safely encode a URL component.
- URL Decode — Decode percent-encoded URL components.
- JSON Validator — Check JSON syntax with clear errors.
How we check calculations and correct errors · Report a problem with this guide