PEM to Base64
Remove PEM armor and whitespace to extract its Base64-encoded DER bytes.
Your workspace
Processed in your browserThis utility extracts the raw Base64-encoded content from a PEM (Privacy-Enhanced Mail) formatted block. PEM files are essentially Base64-encoded DER data wrapped in headers and footers like '-----BEGIN PUBLIC KEY-----'. This tool strips away that armor, leaving you with the clean Base64 string required for many programmatic APIs and cryptographic libraries.
Extracting Base64 data
- Paste your complete PEM block, including the 'BEGIN' and 'END' lines, into the input area.
- The tool automatically identifies the PEM structure, removes the framing, and outputs the raw Base64-encoded string.
- Copy the resulting Base64 string for use in your application or further cryptographic operations.
Understanding PEM and DER
PEM is a text-based format that makes binary data (DER) easier to handle and transport. By converting PEM to Base64, you are essentially exposing the raw encoded data that sits inside the file. This tool does not validate the internal structure of the key, such as its ASN.1 format; it only handles the removal of the text-based framing.
Conversion example
-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...\n-----END PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...
Questions about PEM processing
Does this tool validate the key structure?
No, it only validates that the input is a correctly formatted PEM block and extracts the Base64 content. It does not check if the underlying key is valid.
Can I convert back from Base64 to PEM?
Yes, you can use a separate PEM-encoding tool to re-wrap the Base64 string with the appropriate headers and footers.
Continue your workflow
Explore more tools in this category for your next step.
Base64 to PEM
Wrap Base64 DER text in selected PEM armor with 64-character lines.
PEM Inspector
Inspect a PEM label, decoded byte length, DER root tag and SHA-256 fingerprint locally; encoded private material is not printed in the report.
RSA JWK to PEM
Import an RSA-OAEP JWK and export a PKCS8 or SPKI PEM key.
RSA PEM to JWK
Import RSA PKCS8 private or SPKI public PEM and export a JWK.