Base64 to PEM

Wrap Base64 DER text in selected PEM armor with 64-character lines.

Your workspace

Processed in your browser

Enter your values or try the example.

This tool formats raw Base64-encoded DER data into standard PEM (Privacy-Enhanced Mail) blocks. It adds the necessary header and footer lines and ensures the Base64 content is split into 64-character lines, which is the standard requirement for PEM files.

How to format your key

  1. Paste your Base64-encoded DER string into the input field.
  2. Select the appropriate block type (PUBLIC KEY or PRIVATE KEY) from the menu to apply the correct armor.

Understanding PEM Armor

PEM files are essentially Base64-encoded DER data wrapped in human-readable headers. This tool automates the process of adding these wrappers. It does not validate the internal structure of the DER data; it simply applies the formatting. Ensure the input is strictly the Base64 representation of your DER-encoded key.

Formatting a Public Key

MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...

-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA... -----END PUBLIC KEY-----

Questions about this operation

Does this tool validate that my Base64 data is a valid key?

No, it only wraps the provided data. If the input is not a valid DER-encoded key, the resulting PEM file will be syntactically correct but functionally useless.

Why are there 64-character lines?

The PEM standard specifies that the Base64 content must be split into lines of 64 characters to ensure compatibility with older mail systems and standard text editors.

Continue your workflow

Explore more tools in this category for your next step.