A <b>'''prefix code</b>''', also calledknown as a [['''prefix-free code''' or '''comma-free code]]''', is a [[code]] constructed so that any partial [[code word]], beginning at the consistingstart of stringsa sofull code word but terminating prior to the end of that code word, is not itself a valid code word. In other words, for any given valid [[string (computer science)|string]] in the code, there is no shorter string in the code that is an initial substring of that string.
This property permits the proper [[framing]] of transmitted code words when (a) external [[synchronization]] is provided to identify the start of the first code word in a [[sequence]] of code words and (b) no uncorrected errors occur in the symbol stream.
This means that when strings from the code are put together, you don't need any separators, since it's known when a string ends.
Examples of where prefix codes are usedthe arevariable-length [[Huffman coding|Huffman codes]] and, [[Countrycountry calling codes]], and [[ISBN]]s.
''This article is partly derived from [[Federal Standard 1037C]], which uses the term '''comma-free code'''.''