UTF-8 safe Base64, URL-safe Base64URL, and encodeURIComponent / decodeURIComponent converter.
Choose Base64 for standard binary-to-text, Base64URL for JWT/OAuth tokens (replaces +/ with -_ and strips =), or URL Component for query string parameters.
| Encoding | Special Chars | Padding | Typical Use |
|---|---|---|---|
| Base64 | + and / | = / == | Data URIs, email, Basic Auth |
| Base64URL | - and _ | Omitted | JWT segments, OAuth2 PKCE |
| URL Component | %XX hex | None | Query string values (?q=...) |
btoa only accepts Latin1 bytes. This tool encodes strings via TextEncoder UTF-8 first so Chinese and emojis always work.
Base64URL replaces + with -, / with _, and omits trailing = padding so it can sit safely inside URLs.
For query parameter values, use encodeURIComponent (used here) so &, =, and ? inside values are properly escaped.
Beautify, validate, sort keys, and minify JSON locally in your browser.
Safely decode JWT (JSON Web Token) headers, claims, and human-readable exp/iat dates locally in your browser.
Test and debug JavaScript regular expressions with real-time match highlighting, capture group extraction, and developer presets.
Compare two text blocks, config files, or code snippets line-by-line with added/removed highlighting in your browser.