Xerobit

Code 93 Barcode Generator: Full ASCII with C and K Checks

Enter any ASCII text and this Code 93 barcode generator adds the two modulo 47 check characters, the start and stop patterns and the termination bar. You get the module pattern and a scalable SVG. It runs in your browser and nothing is uploaded.

Code 93 barcode

CODE93
  • Symbol sequence
    * C O D E 9 3 P V *
  • Check character C
    P (value 25)
  • Check character K
    V (value 31)
  • Data characters
    6
  • Symbol characters
    8 plus start and stop
  • Module pattern
    1010111101101000101001011001100101001100100101000010101010000101000101101100110101010111101
  • Width with quiet zones
    111 modules (222 px)

How to use the code 93 barcode generator

  1. Type the text to encode. Digits, capital letters and - . space $ / + % are native; lowercase and other punctuation are encoded as shift pairs.
  2. Choose a module width (the width of the narrowest bar) and a bar height, and decide whether the text is printed below.
  3. Read the check characters C and K and the full symbol sequence in the result table.
  4. Download or copy the SVG and use it on labels or documents with at least 10 modules of blank space on each side.

How Code 93 encoding works

A Code 93 barcode generator has to draw each character as 9 modules containing 3 bars and 3 spaces, which is where the name comes from. There are 47 symbol values: the digits, the capital letters, the symbols - . space $ / + % and four shift characters written ($), (%), (/) and (+). A symbol begins with a bar and ends with a space.

A whole barcode is the start pattern 101011110, the data symbols, check characters C and K, the stop pattern 101011110 and one extra bar, the termination bar. The termination bar is part of the stop pattern and is often forgotten. Without it many scanners reject the symbol.

Calculating check characters C and K

Both checks are weighted sums modulo 47. For C, number the data symbols from the right starting at weight 1, increase the weight by one per symbol and restart at 1 after 20. Multiply each symbol value by its weight, add them and take the remainder when divided by 47.

For TEST93 the values are T=29, E=14, S=28, T=29, 9=9, 3=3. Weights from the right are 1 to 6, so the sum is 3x1 + 9x2 + 29x3 + 28x4 + 14x5 + 29x6 = 464. Since 464 mod 47 = 41, C is the symbol with value 41, which is +.

For K, put C on the right as well, giving it weight 1, and restart the weights after 15. The sum is 41x1 + 3x2 + 9x3 + 29x4 + 28x5 + 14x6 + 29x7 = 617, and 617 mod 47 = 6, so K is 6. The sequence is TEST93+6.

Full ASCII with shift characters

Code 93 itself only has 43 data characters. To encode all 128 ASCII characters, the other characters are written as a shift symbol followed by a capital letter. This Code 93 barcode generator does that automatically and counts the shift symbols in the check calculation, as the specification requires.

ShiftFollowed by A to Z gives
($) + letterControl characters 1 to 26 (SOH to SUB)
(%) + letterControl codes 0 and 27 to 31, plus ; < = > ? [ \ ] ^ _ @ ` { | } ~ and DEL
(/) + letter! " # & ' ( ) * , : and other punctuation
(+) + letterLowercase a to z

So a becomes (+)A and takes two symbols instead of one. Plain characters such as the dollar sign, percent sign, slash and plus sign are encoded natively and do not use a shift. Many readers need full ASCII mode enabled to decode shift pairs.

Native symbol values and patterns

Value, symbol and 9-module pattern for the native characters (1 is a bar, 0 is a space):

ValueSymbolPatternValueSymbolPattern
0010001010010A110101000
1110100100011B110100100
2210100010012C110100010
3310100001013D110010100
4410010100014E110010010
5510010010015F110001010
6610010001016G101101000
7710101000017H101100100
8810001001018I101100010
9910000101019J100110100

Values 20 to 46 follow the same scheme and the generator holds all 47 patterns. The start and stop pattern is 101011110.

Code 93 compared with Code 39 and Code 128

Code 93 is more compact than Code 39 because each symbol needs only 9 modules and has no wide or narrow elements to measure, and it adds two mandatory check characters. It appears in logistics and inventory labelling.

Code 128 is denser still for digit pairs and is the more common choice for new systems. If you need compatibility with older Code 39 readers, use the Code 39 generator; for general shipping labels use the Code 128 generator. Because this Code 93 barcode generator produces the full ASCII form, check that your scanner is configured to expect Code 93 with full ASCII before printing a batch.

Keep at least 10 modules of quiet space on both sides and do not scale the SVG unevenly. Printing at a module width of 0.25 mm or more suits most handheld scanners.

Worked examples

ExampleInputResult
Uppercase and digitsData to encode: TEST93; Module width (px): 2; Bar height (px): 80; Show text below barcode: yes; Background: whiteSymbol sequence: * T E S T 9 3 + 6 *; Check character C: + (value 41); Check character K: 6 (value 6); Data characters: 6; Symbol characters: 8 plus start and stop; Module pattern: 1010111101101001101100100101101011001101001101000010101010000101011101101001000101010111101; Width with quiet zones: 111 modules (222 px)
Lowercase (full ASCII)Data to encode: Hello-1; Module width (px): 2; Bar height (px): 80; Show text below barcode: yes; Background: whiteSymbol sequence: * H (+) E (+) L (+) L (+) O - 1 O . *; Check character C: O (value 24); Check character K: . (value 37); Data characters: 7; Symbol characters: 13 plus start and stop; Module pattern: 1010111101011001001001100101100100101001100101010110001001100101010110001001100101001011001001011101010010001001011001110101001010111101; Width with quiet zones: 156 modules (312 px)
Symbols and punctuationData to encode: A@B#C!; Module width (px): 2; Bar height (px): 80; Show text below barcode: yes; Background: whiteSymbol sequence: * A (%) V B (/) C C (/) A 6 (%) *; Check character C: 6 (value 6); Check character K: (%) (value 44); Data characters: 6; Symbol characters: 11 plus start and stop; Module pattern: 1010111101101010001110110101100110101101001001110101101101000101101000101110101101101010001001000101110110101010111101; Width with quiet zones: 138 modules (276 px)
Wide bars, no text, transparentData to encode: CODE93; Module width (px): 3; Bar height (px): 60; Show text below barcode: no; Background: transparentSymbol sequence: * C O D E 9 3 P V *; Check character C: P (value 25); Check character K: V (value 31); Data characters: 6; Symbol characters: 8 plus start and stop; Module pattern: 1010111101101000101001011001100101001100100101000010101010000101000101101100110101010111101; Width with quiet zones: 111 modules (333 px)

FAQ

What characters does Code 93 support?

It natively encodes digits, capital letters and - . space $ / + %. With shift pairs it encodes all 128 ASCII characters, including lowercase letters.

Why are there two check characters?

C and K are modulo 47 weighted sums. K also covers C, so most single character errors and many transpositions are caught by at least one of them.

Are the check characters part of the printed text?

They are encoded in the bars but readers normally do not output them. This tool shows both in the result table so you can see what was added.

What is the termination bar?

It is one extra bar after the stop pattern, which makes the stop symbol 10 modules wide. Scanners need it to find the end of the barcode.

Is lowercase text converted to uppercase?

No. Lowercase letters are encoded with the (+) shift, so the decoded text keeps its case when the reader is set to full ASCII.

Does this tool upload my data?

No. The barcode is built in your browser and nothing is sent to a server.