RSA Key Format Converter
| Input Format | Convert To |
|---|---|
| PKCS#1 Private Key | PKCS#8 · PKCS#1 · JWK · XML · PEM · DER · Base64 · Hex |
| PKCS#8 Private Key | PKCS#1 · PKCS#8 · JWK · XML · PEM · DER · Base64 · Hex |
| PKCS#1 Public Key | SPKI · OpenSSH · JWK · XML · PEM · DER · Base64 · Hex |
| SPKI Public Key | PKCS#1 · OpenSSH · JWK · XML · PEM · DER · Base64 · Hex |
| OpenSSH | SPKI · PKCS#1 · JWK · XML · PEM · DER · Base64 · Hex |
| JWK | PKCS#1 · PKCS#8 · SPKI · OpenSSH · XML · PEM · DER |
| XML | PKCS#1 · PKCS#8 · SPKI · OpenSSH · JWK · PEM · DER |
| Raw Base64 / Hex | 与对应的 PKCS#1 / PKCS#8 / SPKI 一致 |
Automatically detect and convert public/private keys between PEM, DER, PKCS#1, PKCS#8, SPKI, OpenSSH, JWK, and XML
RSA Key Format Converter
The same RSA key often needs different representations in different environments: Java commonly uses PKCS#8, older OpenSSL toolchains output PKCS#1, SSH requires an OpenSSH public key, frontend applications and cloud services often prefer JWK, while older .NET applications used XML. This tool handles existing keys: it automatically detects what the key is and converts it to the structure and encoding you need.
Input and Automatic Detection
- Two input methods are available: paste text directly or drop pem, key, pub, der, or txt files. The page displays the filename and file size.
- The input format is detected automatically by default, or you can manually select PEM, DER, PKCS#1, PKCS#8, SPKI, OpenSSH, JWK, XML, raw Base64, or raw Hex.
- You do not need to specify whether the input is a public or private key in advance. The tool determines this automatically and filters the available target formats accordingly.
Key Information
After successful parsing, the tool displays the key type (RSA public key or RSA private key), RSA bit length, input encoding, modulus length, and public exponent. This makes it easy to confirm whether the key matches expectations and determine whether a key received from another party is the same key.
Output Formats and Batch Conversion
Output is divided into two dimensions: structure and encoding. Structures include PKCS#1, PKCS#8, SPKI, OpenSSH, JWK, and XML. Encodings include PEM, DER, Base64, and Hex. These can be combined into target formats, and the page automatically filters combinations that are not applicable to public or private keys. Base64 and Hex output the raw encoding without PEM headers or footers, making it convenient to paste into configuration files. DER contains binary data and should be saved as a file through download. Batch conversion allows you to select multiple target formats at once. Each result can be copied or downloaded separately, and a conversion matrix shows the supported conversion directions.
Extract a Public Key from a Private Key
If you only have a private key, you can extract the corresponding public key with one click and output it directly as a PEM, SPKI, or OpenSSH public key. This is useful for server configuration, uploading a key to a code hosting platform, or providing a public key to an integration partner.
Error Handling and Capability Boundaries
- When an encrypted private key is detected, the tool clearly explains that it does not perform online password decryption. Use openssl or PuTTYgen to decrypt and export the key first.
- When EC, DSA, Ed25519, or other non-RSA keys are detected, the tool explains that only RSA keys are supported.
- When an X.509 certificate is detected, the tool recommends using a certificate parser instead.
- When a PuTTY PPK file is detected, the tool explains that this format is not yet supported. PuTTY PPK and MSBLOB currently receive detection notices only.
- Unrecognized content, oversized files, and read failures all produce specific error messages explaining the reason.
Use Cases
- Convert a PKCS#1 private key provided by an integration partner to PKCS#8 for Java.
- Convert a PEM public key to OpenSSH format for use in a server authorization file.
- Convert a key to JWK for frontend applications or JWT signature verification.
- Convert a key to raw Base64 for environment variables or JSON configuration.
Privacy and Data Security
All parsing and conversion are performed locally in the browser. Keys are not uploaded to or saved on a server. The tool only identifies, converts, and exports existing keys. It does not generate new keys, recover private keys, or provide online decryption. If you do not have a key yet, use the RSA key generator.
Identify and Convert RSA Key Formats Online
- Automatically detect key type and input format, or manually select PEM, DER, PKCS#1, PKCS#8, SPKI, OpenSSH, JWK, XML, raw Base64, or raw Hex
- Select structure and encoding independently, freely combine PEM, DER, Base64, and Hex, and filter available targets by public or private key
- Display key information including type, RSA bit length, encoding, modulus length, and public exponent
- Extract a public key from a private key with one click and output it directly as an OpenSSH public key
- Batch conversion: select multiple target formats and generate them at once, with each result available for separate copying or download
- Support both text pasting and file dropping, including pem, key, pub, der, and txt files