JWK Generator — PEM to JWK, JWK to PEM & JWKS Generator | Authgear
JWK Generator — Convert PEM to JWK & Generate JWKS
Generate and convert cryptographic keys in PEM and JWK formats for secure signing and encryption.
PEM to JWK
Enter a PEM encoded key or certificate
Key ID (kid)
**Key Algorithm (alg) **
- (unspecified)
- RS256 (RSA)
- RS384 (RSA)
- RS512 (RSA)
- PS256 (RSA-PSS)
- PS384 (RSA-PSS)
- PS512 (RSA-PSS)
- ES256 (ECDSA)
- ES384 (ECDSA)
- ES512 (ECDSA)
- EdDSA (Ed25519)
Key Use (use)
- (unspecified)
- Signature
- Encryption
Generate JWK
JWK (JSON Web Key)
Enter a PEM key and click "Generate JWK" to see the output
JWK (JSON Web Key)
Convert to PEM
PEM Output
Enter a JWK and click "Convert to PEM" to see the output
JWK Format Help:
- RSA Keys: Require
kty,kid,n(modulus), ande(exponent) - EC Keys: Require
kty,kid,crv(curve),x, andycoordinates - OKP Keys: Require
kty,kid,crv(curve), andx(public key) - Private keys include additional fields like
d(private key component)
Key Use
- Signature: For creating and verifying digital signatures
- Encryption: For encrypting and decrypting data
Key Type
- RSA - Digital signatures (most versatile)
- ECDSA - Digital signatures (faster, smaller keys)
- Ed25519 - Modern digital signatures
- HMAC - Symmetric signatures
Supports multiple signature algorithms
Key Algorithm
- RS256 (RSA + SHA-256)
- RS384 (RSA + SHA-384)
- RS512 (RSA + SHA-512)
- PS256 (RSA-PSS + SHA-256)
- PS384 (RSA-PSS + SHA-384)
- PS512 (RSA-PSS + SHA-512)
Key Size (bits)
- 1024 bits
- 2048 bits (recommended)
- 4096 bits
Key ID (kid) A unique identifier for this key. If left empty, a SHA256 fingerprint will be generated automatically.
Generate Key
Building authentication into your app?
Start Building →
Our lightweight JWK generator runs entirely in your browser — no keys leave your machine. Use it to convert PEM to JWK, convert JWK to PEM, or generate new keys and export a JWKS for your jwks_uri endpoint. Learn more: What is JWKS
How the JWK Generator Works
Step 1.
Convert Between PEM and JWK:
- Paste your PEM key to convert it into a JSON Web Key format or vice versa.
- Copy the converted key for use in your applications.
- Why use PEM → JWK? Many libraries and identity platforms expect JWK/JWKS. Converting PEM to JWK makes your keys consumable by JWT verification flows and by any service that reads a jwks.json at a jwks_uri.
Step 2.
Generate New Keys:
- Select whether you want a key for signature or encryption tasks.
- Choose the key type suitable for your security needs, such as symmetric (oct), RSA, or elliptic curve (EC or OKP).
- Pick the cryptographic algorithm to match your system requirements (e.g., RS256 for RSA signature).
- Receive the generated keys:
- Symmetric:
- a. Secret key string + JWK JSON.
- b. Asymmetric: PEM-formatted private and public keys + corresponding JWK objects for private and public key parts.
- Symmetric:
Step 3.
Use Your Keys Securely:
- Implement these keys to sign or encrypt JWTs.
- Host JWK sets on your authorization servers for key discovery.
- Rotate and manage keys easily for robust security posture.
What is a JWK (JSON Web Key)?
A JWK is a JSON data structure that represents a cryptographic key. A JWKS (JSON Web Key Set) is an object with a keys array of JWKs. JWKS is the standard format used by identity providers to publish public keys at a jwks_uri so clients can validate JWT tokens (see RFC 7517).
What is PEM
PEM (Privacy Enhanced Mail) is the base64-encoded format commonly used to store and share cryptographic keys and certificates. Use PEM to JWK conversions to make PEM keys consumable by JWKS endpoints and modern JOSE libraries.
Best Practices
- Never use generated private keys in production. For production, generate and store private keys in a secure HSM or KMS.
- Use appropriate key sizes and modern algorithms (e.g., Ed25519 when supported).
- Host JWKS over HTTPS at a stable jwks_uri and rotate keys regularly — publish new keys with new kid values and remove deprecated keys safely.
- Include kid and alg metadata in your JWKs so clients can select the right key when verifying JWTs.