Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code 39
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Encoding == The '''*''' character presented below is not a true encodable character, but is the start and stop symbol for Code 39. The asymmetry of the symbol allows the reader to determine the direction of the barcode being scanned. This code is traditionally mapped to the '''*''' character in barcode [[font]]s and will often appear with the human-readable representation alongside the barcode. [[File:Free 3 of 9 (Code 39 barcode).svg|thumb|Code 39 characters]] As a generality, the location of the two wide bars can be considered to encode a number between 1 and 10, and the location of the wide space (which has four possible positions) can be considered to classify the character into one of four groups (from left to right): Letters(+30) (U–Z), Digits(+0) (1–9,0), Letters(+10) (A–J), and Letters(+20) (K–T). For example, the letter P (being the 16th letter of the alphabet) has its bars aligned to represent the number 6, and the space in the far right position to select the group Letters(+20). When represented as a digit, the number "10" is used to encode the number zero. Because there are only six letters in the Letters(+30) group (letters 30–35, or U–Z), the other four positions in this group (36–39) are used to represent three symbols (dash, period, space) as well as the start/stop character. The two wide bars, out of five possible positions, encode a number between 1 and 10 using a [[two-out-of-five code]] with the following numeric equivalence: 1, 2, 4, 7, 0. The numbers are summed together. For example, the number 6 is encoded NWWNN, with wide bars occupying the positions for 2 and 4 (2+4=6). In the case of NNWWN which is {{nobr|1=4+7 = 11}} it is assigned to 0 for digits (+0), and 10 for the letter columns (+10 – +30). When encoding the (+10 to +30) letters the equation needs a "−1" added so 'A' is WNNNW → 1 + 10 − 1 → 10 as shown in the table. The last four characters consist of all narrow bars and three wide spaces. There are four possible positions for the single narrow space. This table outlines the Code 39 specification. The numeric value assigned to each character (except start/stop) is used in the checksum algorithm described below. {| class="wikitable" |+ Code 39 characters (and checksum values) !rowspan=2 colspan=2| Bars ||colspan=12| Spaces |- !colspan=2| {{pipe}}{{pipe}} {{pipe}}{{pipe}}{{pipe}} || +0 ||colspan=2| {{pipe}}{{pipe}}{{pipe}} {{pipe}}{{pipe}} || +10 ||colspan=2| {{pipe}}{{pipe}}{{pipe}}{{pipe}} {{pipe}} ||+20 ||colspan=2| {{pipe}} {{pipe}}{{pipe}}{{pipe}}{{pipe}} || +30 |- ! ▮{{pipe}}{{pipe}}{{pipe}}▮ || 1 | ▮{{pipe}} {{pipe}}{{pipe}}▮ || 1 || 1 || ▮{{pipe}}{{pipe}} {{pipe}}▮ || A || 10 || ▮{{pipe}}{{pipe}}{{pipe}} ▮ || K || 20 || ▮ {{pipe}}{{pipe}}{{pipe}}▮ || U || 30 |- ! {{pipe}}▮{{pipe}}{{pipe}}▮ || 2 | {{pipe}}▮ {{pipe}}{{pipe}}▮ || 2 || 2 || {{pipe}}▮{{pipe}} {{pipe}}▮ || B || 11 || {{pipe}}▮{{pipe}}{{pipe}} ▮ || L || 21 || {{pipe}} ▮{{pipe}}{{pipe}}▮ || V || 31 |- ! ▮▮{{pipe}}{{pipe}}{{pipe}} || 3 | ▮▮ {{pipe}}{{pipe}}{{pipe}} || 3 || 3 || ▮▮{{pipe}} {{pipe}}{{pipe}} || C || 12 || ▮▮{{pipe}}{{pipe}} {{pipe}} || M || 22 || ▮ ▮{{pipe}}{{pipe}}{{pipe}} || W || 32 |- ! {{pipe}}{{pipe}}▮{{pipe}}▮ || 4 | {{pipe}}{{pipe}} ▮{{pipe}}▮ || 4 || 4 || {{pipe}}{{pipe}}▮ {{pipe}}▮ || D || 13 || {{pipe}}{{pipe}}▮{{pipe}} ▮ || N || 23 || {{pipe}} {{pipe}}▮{{pipe}}▮ || X || 33 |- ! ▮{{pipe}}▮{{pipe}}{{pipe}} || 5 | ▮{{pipe}} ▮{{pipe}}{{pipe}} || 5 || 5 || ▮{{pipe}}▮ {{pipe}}{{pipe}} || E || 14 || ▮{{pipe}}▮{{pipe}} {{pipe}} || O || 24 || ▮ {{pipe}}▮{{pipe}}{{pipe}} || Y || 34 |- ! {{pipe}}▮▮{{pipe}}{{pipe}} || 6 | {{pipe}}▮ ▮{{pipe}}{{pipe}} || 6 || 6 || {{pipe}}▮▮ {{pipe}}{{pipe}} || F || 15 || {{pipe}}▮▮{{pipe}} {{pipe}} || P || 25 || {{pipe}} ▮▮{{pipe}}{{pipe}} || Z || 35 |- ! {{pipe}}{{pipe}}{{pipe}}▮▮ || 7 | {{pipe}}{{pipe}} {{pipe}}▮▮ || 7 || 7 || {{pipe}}{{pipe}}{{pipe}} ▮▮ || G || 16 || {{pipe}}{{pipe}}{{pipe}}▮ ▮ || Q || 26 || {{pipe}} {{pipe}}{{pipe}}▮▮ || - || 36 |- ! ▮{{pipe}}{{pipe}}▮{{pipe}} || 8 | ▮{{pipe}} {{pipe}}▮{{pipe}} || 8 || 8 || ▮{{pipe}}{{pipe}} ▮{{pipe}} || H || 17 || ▮{{pipe}}{{pipe}}▮ {{pipe}} || R || 27 || ▮ {{pipe}}{{pipe}}▮{{pipe}} || . || 37 |- ! {{pipe}}▮{{pipe}}▮{{pipe}} || 9 | {{pipe}}▮ {{pipe}}▮{{pipe}} || 9 || 9 || {{pipe}}▮{{pipe}} ▮{{pipe}} || I || 18 || {{pipe}}▮{{pipe}}▮ {{pipe}} || S || 28 || {{pipe}} ▮{{pipe}}▮{{pipe}} || [[space (punctuation)|␣]] || 38 |- ! {{pipe}}{{pipe}}▮▮{{pipe}} || 10 | {{pipe}}{{pipe}} ▮▮{{pipe}} || 0 || 0 || {{pipe}}{{pipe}}▮ ▮{{pipe}} || J || 19 || {{pipe}}{{pipe}}▮▮ {{pipe}} || T || 29 || {{pipe}} {{pipe}}▮▮{{pipe}} || * || |- !colspan=14| |- ! {{pipe}}{{pipe}}{{pipe}}{{pipe}}{{pipe}} || | {{pipe}} {{pipe}} {{pipe}} {{pipe}}{{pipe}} || $ || 39 || {{pipe}} {{pipe}} {{pipe}}{{pipe}} {{pipe}} || / || 40 || {{pipe}} {{pipe}}{{pipe}} {{pipe}} {{pipe}} || + || 41 || {{pipe}}{{pipe}} {{pipe}} {{pipe}} {{pipe}} || % || 42 |} Characters are separated by an additional narrow space. For example, the full encoding for the single letter "A", which actually includes the start and stop characters as "*A*", is {{nobreak |"{{pipe}} {{pipe}}▮▮{{pipe}}▮{{pipe}}{{pipe}} {{pipe}}▮{{pipe}} {{pipe}}▮▮{{pipe}}"}}. The code will not be read properly without these inter-character spaces. Barcode fonts invariably include this space within the glyph for the character.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)