How this one works
The algorithm comes from the token's header, and the key field follows it: a secret for HS256, HS384 and HS512, a public key for RS, PS, ES and EdDSA. The browser's built-in WebCrypto recomputes the signature over header.payload and compares it in constant time.
Public keys can be pasted as a PEM block, an X.509 certificate, a JWK or a whole JWKS. With a JWKS, the key whose kid matches the token's is used. A secret is read as plain text unless you switch it to Base64, because the same characters are different bytes.
Questions
Does my secret or key get sent anywhere?
No. It's held in memory in this tab and passed to WebCrypto, which runs in your browser. It isn't saved to storage either, so closing the tab forgets it.
Why does a valid-looking token say the signature does not match?
Most often the wrong key: an old key after the issuer rotated, the staging key for a production token, or a secret stored as Base64 read as plain text. If none of those, the token was changed after it was signed.
The signature is valid: is the token safe to accept?
Not by itself. Also check exp and nbf, that iss and aud are what you expect, and that the alg is the one your server requires rather than whatever the token claims. The checks under the claims cover the first part.
Can I paste a private key?
It works, and only the public half is used, but a private key should never be pasted into a web page. Export the public key instead.