
Extrapolated Barcode Specs |
Compiled by Nick Johnson. |
Code 128 is a higher-density coding scheme capable of encoding the standard ASCII character set and 100 discrete numeric values (0-99). Unlike the other codes on this site, Code 128 has 3 character sets. Each character set encodes a subset of the total characters that can be encoded with Code 128. There is one start character for each character set, and character sets may be changed anywhere in the code as well.
Each character except the stop character is of width 11, containing 3 bars and 3 spaces of one of 4 widths. The stop character is width 13.
All Code 128 barcodes have a check digit at the end. The check digit is computed by adding the value of the start character, then the position of each character times its value, and taking the modulus 103 of the resulting sum. For example, if we were using character set B, with the message "XYZ", the sum would be (104) + (1 * 56) + (2 * 57) + (3 * 58). The character sets with their values and bar/space codes are below. Each positive number is a bar with that width; each negative number is a space with that width.
| Set A | Set B | Set C | Value | Bar/Space widths |
|---|---|---|---|---|
| 00 | 0 | 2 -1 2 -2 2 -2 | ||
| ! | ! | 01 | 1 | 2 -2 2 -1 2 -2 |
| " | " | 02 | 2 | 2 -2 2 -2 2 -1 |
| # | # | 03 | 3 | 1 -2 1 -2 2 -3 |
| $ | $ | 04 | 4 | 1 -2 1 -3 2 -2 |
| % | % | 05 | 5 | 1 -3 1 -2 2 -2 |
| & | & | 06 | 6 | 1 -2 2 -2 1 -3 |
| ' | ' | 07 | 7 | 1 -2 2 -3 1 -2 |
| ( | ( | 08 | 8 | 1 -3 2 -2 1 -2 |
| ) | ) | 09 | 9 | 2 -2 1 -2 1 -3 |
| * | * | 10 | 10 | 2 -2 1 -3 1 -2 |
| + | + | 11 | 11 | 2 -3 1 -2 1 -2 |
| , | , | 12 | 12 | 1 -1 2 -2 3 -2 |
| - | - | 13 | 13 | 1 -2 2 -1 3 -2 |
| . | . | 14 | 14 | 1 -2 2 -2 3 -1 |
| / | / | 15 | 15 | 1 -1 3 -2 2 -2 |
| 0 | 0 | 16 | 16 | 1 -2 3 -1 2 -2 |
| 1 | 1 | 17 | 17 | 1 -2 3 -2 2 -1 |
| 2 | 2 | 18 | 18 | 2 -2 3 -2 1 -1 |
| 3 | 3 | 19 | 19 | 2 -2 1 -1 3 -2 |
| 4 | 4 | 20 | 20 | 2 -2 1 -2 3 -1 |
| 5 | 5 | 21 | 21 | 2 -1 3 -2 1 -2 |
| 6 | 6 | 22 | 22 | 2 -2 3 -1 1 -2 |
| 7 | 7 | 23 | 23 | 3 -1 2 -1 3 -1 |
| 8 | 8 | 24 | 24 | 3 -1 1 -2 2 -2 |
| 9 | 9 | 25 | 25 | 3 -2 1 -1 2 -2 |
| : | : | 26 | 26 | 3 -2 1 -2 2 -1 |
| ; | ; | 27 | 27 | 3 -1 2 -2 1 -2 |
| < | < | 28 | 28 | 3 -2 2 -1 1 -2 |
| = | = | 29 | 29 | 3 -2 2 -2 1 -1 |
| > | > | 30 | 30 | 2 -1 2 -1 2 -3 |
| ? | ? | 31 | 31 | 2 -1 2 -3 2 -1 |
| @ | @ | 32 | 32 | 2 -3 2 -1 2 -1 |
| A | A | 33 | 33 | 1 -1 1 -3 2 -3 |
| B | B | 34 | 34 | 1 -3 1 -1 2 -3 |
| C | C | 35 | 35 | 1 -3 1 -3 2 -1 |
| D | D | 36 | 36 | 1 -1 2 -3 1 -3 |
| E | E | 37 | 37 | 1 -3 2 -1 1 -3 |
| F | F | 38 | 38 | 1 -3 2 -3 1 -1 |
| G | G | 39 | 39 | 2 -1 1 -3 1 -3 |
| H | H | 40 | 40 | 2 -3 1 -1 1 -3 |
| I | I | 41 | 41 | 2 -3 1 -3 1 -1 |
| J | J | 42 | 42 | 1 -1 2 -1 3 -3 |
| K | K | 43 | 43 | 1 -1 2 -3 3 -1 |
| L | L | 44 | 44 | 1 -3 2 -1 3 -1 |
| M | M | 45 | 45 | 1 -1 3 -1 2 -3 |
| N | N | 46 | 46 | 1 -1 3 -3 2 -1 |
| O | O | 47 | 47 | 1 -3 3 -1 2 -1 |
| P | P | 48 | 48 | 3 -1 3 -1 2 -1 |
| Q | Q | 49 | 49 | 2 -1 1 -3 3 -1 |
| R | R | 50 | 50 | 2 -3 1 -1 3 -1 |
| S | S | 51 | 51 | 2 -1 3 -1 1 -3 |
| T | T | 52 | 52 | 2 -1 3 -3 1 -1 |
| U | U | 53 | 53 | 2 -1 3 -1 3 -1 |
| V | V | 54 | 54 | 3 -1 1 -1 2 -3 |
| W | W | 55 | 55 | 3 -1 1 -3 2 -1 |
| X | X | 56 | 56 | 3 -3 1 -1 2 -1 |
| Y | Y | 57 | 57 | 3 -1 2 -1 1 -3 |
| Z | Z | 58 | 58 | 3 -1 2 -3 1 -1 |
| [ | [ | 59 | 59 | 3 -3 2 -1 1 -1 |
| \ | \ | 60 | 60 | 3 -1 4 -1 1 -1 |
| ] | ] | 61 | 61 | 2 -2 1 -4 1 -1 |
| ^ | ^ | 62 | 62 | 4 -3 1 -1 1 -1 |
| _ | _ | 63 | 63 | 1 -1 1 -2 2 -4 |
| ^@ NUL | ` | 64 | 64 | 1 -1 1 -4 2 -2 |
| ^A SOH | a | 65 | 65 | 1 -2 1 -1 2 -4 |
| ^B STX | b | 66 | 66 | 1 -2 1 -4 2 -1 |
| ^C ETX | c | 67 | 67 | 1 -4 1 -1 2 -2 |
| ^D EOT | d | 68 | 68 | 1 -4 1 -2 2 -1 |
| ^E ENQ | e | 69 | 69 | 1 -1 2 -2 1 -4 |
| ^F ACK | f | 70 | 70 | 1 -1 2 -4 1 -2 |
| ^G BEL | g | 71 | 71 | 1 -2 2 -1 1 -4 |
| ^H BS | h | 72 | 72 | 1 -2 2 -4 1 -1 |
| ^I HT | i | 73 | 73 | 1 -4 2 -1 1 -2 |
| ^J LF | j | 74 | 74 | 1 -4 2 -2 1 -1 |
| ^K VT | k | 75 | 75 | 2 -4 1 -2 1 -1 |
| ^L FF | l | 76 | 76 | 2 -2 1 -1 1 -4 |
| ^M CR | m | 77 | 77 | 4 -1 3 -1 1 -1 |
| ^N SO | n | 78 | 78 | 2 -4 1 -1 1 -2 |
| ^O SI | o | 79 | 79 | 1 -3 4 -1 1 -1 |
| ^P DLE | p | 80 | 80 | 1 -1 1 -2 4 -2 |
| ^Q DC1 | q | 81 | 81 | 1 -2 1 -1 4 -2 |
| ^R DC2 | r | 82 | 82 | 1 -2 1 -2 4 -1 |
| ^S DC3 | s | 83 | 83 | 1 -1 4 -2 1 -2 |
| ^T DC4 | t | 84 | 84 | 1 -2 4 -1 1 -2 |
| ^U NAK | u | 85 | 85 | 1 -2 4 -2 1 -1 |
| ^V SYN | v | 86 | 86 | 4 -1 1 -2 1 -2 |
| ^W ETB | w | 87 | 87 | 4 -2 1 -1 1 -2 |
| ^X CAN | x | 88 | 88 | 4 -2 1 -2 1 -1 |
| ^Y EM | y | 89 | 89 | 2 -1 2 -1 4 -1 |
| ^Z SUB | z | 90 | 90 | 2 -1 4 -1 2 -1 |
| ^[ ESC | { | 91 | 91 | 4 -1 2 -1 2 -1 |
| ^\ FS | | | 92 | 92 | 1 -1 1 -1 4 -3 |
| ^] GS | } | 93 | 93 | 1 -1 1 -3 4 -1 |
| ^^ RS | ~ | 94 | 94 | 1 -3 1 -1 4 -1 |
| ^_ US | ^? DEL | 95 | 95 | 1 -1 4 -1 1 -3 |
| FNC3 | FNC3 | 96 | 96 | 1 -1 4 -3 1 -1 |
| FNC2 | FNC2 | 97 | 97 | 4 -1 1 -1 1 -3 |
| SHIFTB | SHIFTA | 98 | 98 | 4 -1 1 -3 1 -1 |
| CODEC | CODEC | 99 | 99 | 1 -1 3 -1 4 -1 |
| CODEB | FNC4 | CODEB | 100 | 1 -1 4 -1 3 -1 |
| FNC4 | CODEA | CODEA | 101 | 3 -1 1 -1 4 -1 |
| FNC1 | FNC1 | FNC1 | 102 | 4 -1 1 -1 3 -1 |
| STARTA | STARTA | STARTA | 103 | 2 -1 1 -4 1 -2 |
| STARTB | STARTB | STARTB | 104 | 2 -1 1 -2 1 -4 |
| STARTC | STARTC | STARTC | 105 | 2 -1 1 -2 3 -2 |
| STOP | STOP | STOP | 2 -3 3 -1 1 -1 2 |
You can make a code 128 barcode here:
(this barcode generator uses only character set B of code 128)|
Codabar |
Code 2 of 5 |
Code 3 of 9 |
Interleaved 2 of 5 |
|
Postnet |
UPC |
Code 128 |
Code 16k |
|
|
|
|
| Thu Jul 24 11:00:53 PDT 2008 | barcode/code128.src | Updated: Thu Aug 18 2005 9:31.35 | Viewed: never |