RSA Key Formatter

How PEM Formatting Works

PEM data is reformatted with proper line wrapping according to RFC 7468.

  1. 1

    Parse PEM structure

    The header, footer, and Base64 body are identified and extracted.

  2. 2

    Remove existing line breaks

    All whitespace and line breaks are removed from the Base64 body.

  3. 3

    Re-wrap at 64 characters

    The Base64 body is re-wrapped with line breaks every 64 characters.

FAQ

What is PEM format?
PEM (Privacy-Enhanced Mail) is a Base64-encoded format for storing cryptographic objects, enclosed between header and footer lines like -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----.
Why does PEM need 64-character line wrapping?
PEM specification (RFC 7468) requires the Base64 body to be wrapped at 64 characters per line. Some systems may reject PEM files without proper line wrapping.
Can I format non-RSA keys?
Yes, this formatter works with any PEM-encoded data including RSA keys, EC keys, certificates, CSRs, and other PEM objects.

Related Tools