URN Code 40 Encoder/Decoder

A tool for encoding and decoding text using the URN Code 40 specification with extended encoding support

Plain Text

URN Code 40 Encoded

When checked, padding spaces in encoded text will appear as spaces in decoded text
About URN Code 40

URN Code 40 is an encoding scheme that provides a method to encode data in conformity with the urn:oid namespace scheme.

It compacts three characters into two bytes (four hex digits) using the formula:

(1600*C1) + (40*C2) + C3 + 1

Basic Character Set: A-Z, 0-9, space, hyphen (-), period (.) and colon (:).

Extended Encoding

URN Code 40 also supports extended encoding for additional characters and features:

  • FB: Long numeric strings (9-24 digits) are encoded more efficiently
  • FC: ISO/IEC 646 characters not in the base table
  • FD: Double-byte UTF-8 characters
  • FE: Triple-byte UTF-8 characters

This implementation automatically selects the most efficient encoding method for any given input, ensuring optimal use of space.