Building the tutorial JWT from scratch, and what changes with a key pair
The token used in nearly every JWT tutorial is easy to rebuild here, which is a good way to see that signing involves no magic. Choose HS256 as the Algorithm. In Claims (JSON) write {"sub":"1234567890","name":"John Doe","iat":1516239022}, and type your-256-bit-secret as the Secret. The Token box shows eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c, character for character the token the tutorials print.
Here is where each piece comes from. The header is {"alg":"HS256","typ":"JWT"}, 27 bytes of JSON, which Base64url turns into the 36 characters eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. The claims are 55 bytes of JSON and become the 74 characters between the two dots. Those two strings joined by a dot are the signing input. The page computes HMAC-SHA256 of that input with the secret as the key, gets 32 bytes beginning 49 f9 4a c7, and writes them in Base64url as SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c. Change the name to Jane Doe and the middle part and the whole signature change; the header stays the same.
The order and spacing of the JSON matter. The signature covers the exact characters, so {"sub":"1"} and { "sub": "1" } give different tokens, both valid. That is why a server never re-encodes claims before checking a signature: it checks the text it was given.
Now switch the Algorithm to ES256 and press Make a new key pair. Your browser generates a fresh P-256 key on this device. The Private key (PEM, PKCS#8) box fills with the signing half, and the Public key appears below it. Sign the same claims and the third part of the token is now 86 characters: 64 bytes, made of two 32-byte numbers, r and s, side by side. RFC 7518 requires exactly that layout in a JWT, rather than the DER encoding OpenSSL prints, and it is what Web Crypto produces, so nothing is converted. Sign twice and you get two different signatures, because ECDSA uses a fresh random number each time; both verify.
This is the real difference between the two families. With HS256, whoever can check a token can also create one, because both use the same secret. With ES256, RS256, PS256 or EdDSA, you can hand the public key to every service that needs to check tokens and keep the private key in one place. Paste the token and the public key into the JWT Decoder and it reports Signature verified; paste the same token with a different public key and it does not.
Use what you make here for what it is good at: testing an API, reproducing a bug, learning the format. Real tokens should come from your own auth server, with short expiry times, which Expires in makes easy to practise. And treat the key with care. The page never sends it anywhere, but a token is only as trustworthy as the secret or private key behind it, so do not paste production keys into any web page, this one included, unless you are sure of the machine you are on.