Encode a JSON header and payload into compact JOSE token form.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
A JSON header and payload are UTF-8 serialized, Base64url-encoded, joined with periods, and optionally signed using the selected JOSE algorithm. The encoded bytes are the signing input, so serialization choices affect the resulting token.
{"sub":"1234567890","name":"John Doe","role":"admin","iat":1516239022}
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwicm9sZSI6ImFkbWluIiwiaWF0IjoxNTE2MjM5MDIyfQ.9AILqmNntS1nzSGb8Y_2HqmgQRoUhw5syBVsIoACMYE
API clients, JOSE fixtures, and signed integration requests encode tokens.