Skip to main content

Private Key Format Converter

PKCS#1 ↔ PKCS#8, SPKI ↔ PKCS#1 public, PEM ↔ DER — keys never leave the browser

Paste a key (PEM)

About the Key Format Converter

RSA keys come in two PEM flavors that trip everyone up: PKCS#1 (BEGIN RSA PRIVATE KEY, the OpenSSL genrsa classic) and PKCS#8 (BEGIN PRIVATE KEY, what Java, AWS KMS imports, and modern tooling expect). Public keys have the same split — SPKI (BEGIN PUBLIC KEY) versus PKCS#1 (BEGIN RSA PUBLIC KEY). Loaders usually want one specific flavor and fail opaquely on the other.

Paste any of the four RSA key PEMs and this converter validates it with Web Crypto, then emits every other representation: both PEM flavors and the raw DER hex. The PKCS#1 ↔ PKCS#8 re-wrapping is done with a local DER encoder — the key material is never transmitted and never leaves the tab.

How to use

  1. Paste your key PEM — the format is detected from the armor label.
  2. Click convert — the key is first validated by importing it into Web Crypto.
  3. Copy the flavor your target system expects (e.g. PKCS#8 for AWS KMS imports).
  4. DER hex is available for tools that want raw bytes.

Frequently Asked Questions

What is the difference between PKCS#1 and PKCS#8?

PKCS#1 (BEGIN RSA PRIVATE KEY) is the RSA-specific format from older OpenSSL: just the key components in a SEQUENCE. PKCS#8 (BEGIN PRIVATE KEY) is the generic envelope that wraps the same key with an algorithm identifier — which is why Java, AWS KMS, and most modern libraries standardize on it. The underlying key material is identical; only the DER wrapper differs, which is why conversion is lossless.

Is it safe to paste a private key here?

The conversion runs entirely in this browser tab — parsing, DER re-wrapping, and validation via Web Crypto. There is no upload endpoint (verify in your network tab). That said, production private keys should live in HSMs or managed key stores; use this for the keys you are actively wiring into systems, and rotate anything you have pasted into tools you do not control.

Is this tool free to use?

Yes! This tool is 100% free. No signup, no credit card, no limits. It's part of Formatho's privacy-first developer toolkit.

Is my data safe? Does this tool send data to a server?

Absolutely. This tool runs entirely in your browser. Your data never leaves your device. Zero server-side processing, zero tracking.