Skip to content

Base64URL Encoder

Runs in your browser

The URL-safe variant every JWT segment uses. Encode text or decode a segment, with UTF-8 handled properly.

Text

How this one works

Base64URL is standard Base64 with + and / swapped for - and _, and the trailing = padding removed, so the result can sit in a URL or a JWT without escaping.

Text is converted to UTF-8 bytes before encoding, so accents, emoji and non-Latin scripts round-trip correctly. Decoding also accepts standard Base64 and padding.

Questions

Is Base64URL encryption?

No. It's an encoding, reversible by anyone. That's why a JWT's payload is readable without a key; only the signature protects it from being changed.

Why does decoding say the result is binary?

Some Base64URL strings hold raw bytes rather than text, such as a JWT signature. Those can't be shown as characters, so the bytes are shown as hex instead.

What's the difference from regular Base64?

Two characters and the padding. Regular Base64 uses + and / and pads with =, all of which have special meaning in URLs. Base64URL avoids them.

How do I decode one part of a JWT?

Copy the part between two dots, paste it here and choose Decode. The first part is the header and the second is the payload, and both come out as JSON. The third part is the signature, which comes out as binary. The JWT Decoder splits and decodes all three at once.

Why is the encoded text longer than the original?

Base64URL writes every 3 bytes as 4 characters, so the result is about a third longer. Accented letters and emoji take more than one byte each in UTF-8, so text that uses them grows a little more.

Where else is Base64URL used?

Anywhere binary data has to travel in a URL, a header or a file name without escaping. Besides every JWT, it is used for OAuth PKCE code challenges, WebAuthn credential ids and many API keys and tokens.

Keyboard shortcuts

Global

  • Show this shortcuts dialogShift?
  • Toggle light / dark themeCtrlShiftL
  • Close dialogsEsc

Formatter & Validator

  • Format JSONCtrlEnter
  • Minify JSONCtrlShiftM
  • Copy outputCtrlShiftC
  • Download output as .jsonCtrlShiftS
  • Clear input and outputCtrlShiftX

Tree Viewer

  • Focus the search box/
  • Expand all nodesCtrlShiftE
  • Collapse all nodesCtrlShiftR

Diff

  • Swap document A and BCtrlShiftS

Time & date tools

  • Use the current time (Epoch Converter)CtrlEnter
  • Copy the main resultCtrlShiftC
  • Clear the inputCtrlShiftX

PHP Unserialize & Serialize

  • Convert an input over 2 MBCtrlEnter
  • Copy outputCtrlShiftC
  • Download outputCtrlShiftS
  • Clear input and outputCtrlShiftX

Keys & IDs

  • Generate a new token or UUID batchCtrlEnter
  • Copy the resultCtrlShiftC

JSON tools

JSON FormatterPretty-print or minify
JSON ValidatorCheck strict JSON validity
JSON Tree ViewerBrowse JSON as a tree
JSON DiffCompare two documents
JSON Path FinderExplore JSONPath expressions
JSON to CSVFlatten JSON into rows
CSV to JSONTurn rows back into objects
PHP UnserializeSerialized PHP to JSON
PHP SerializeJSON to serialized PHP

JWT tools

JWT DecoderClaims, signature and expiry
JWT VerifierWith a secret, PEM key or JWKS
JWT Expiry Checkeriat, nbf and exp in local time
JWT GeneratorBuild a signed test token
Base64URL EncoderEncode or decode a segment

Time & date tools

Epoch ConverterTimestamps to real dates
Cron Expression ExplainerCron in plain English
Time Zone ConverterOne moment, many cities
Duration CalculatorDate maths and durations

Keys & IDs

Password GeneratorSecure random secrets
UUID Generatorv1, v4, v5 or v7 UUIDs

Code formatters

SQL FormatterBeautify or minify SQL
HTML FormatterBeautify or minify HTML
CSS FormatterBeautify or minify CSS
JavaScript FormatterBeautify or minify JS
PHP FormatterBeautify PHP code
Markdown to HTMLConvert with a live preview

AI tools

Token CounterTokens for every model
Prompt Secret ScrubberHide keys and personal data

Pages

JSON toolsFormat, validate, compare and convert JSON.
JWT toolsDecode, verify and generate JSON Web Tokens.
Time & date toolsConvert timestamps, read cron, compare zones.
Keys & IDsGenerate secure tokens, passwords and UUIDs.
Code formattersFormat SQL, HTML, CSS, JavaScript and PHP code.
AI toolsCount tokens and hide secrets before you prompt.
HomePopular tools and categories
All categoriesBrowse tools by category
AboutWhat ToolJar is and why
PrivacyWhat is and is not collected

Theme

Switch to light theme
Switch to dark theme