Tool to decode/encode with AMI. The (bipolar) Alternate Mark Inversion is a line coding for binary signal with a 3-level system representing logical ones by an impulsion with alternative positive or negative polarity.
Alternate Mark Inversion Code - dCode
Tag(s) : Telecom
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The AMI code replaces each logical 1 by a polarity inversion noted with + (plus) and - (minus). Some notations use +1 and -1 (instead of + and -) but the vast majority of the time, the 1 is ignored as, it is implied.
For each logical 0 (zero), nothing to do: 0 is coded, and for each logical 1 (one), a polarity impulsion is coded: alternatively (+ or -), beginning by +.
Example: The binary/logical signal 101 is coded +0-:
1 is coded +
0 remains 0
1 becomes - (polarity changed)
AMI code decryption process replaces each + or - by a logical 1, the rest (the zeros) is 0.
Example: +0- is decoded 101
The signal is bipolair (positive and negative) and has three levels, that can be coded with 3 distinct characters, generally +, - and 0. Sometimes the 1 is still written after + and -.
There is never two consecutive upper ++ or lower -- levels when coding.
A signal beginning with a negative polarity starts with a 1 at the beginning of the plain signal and causes a suppression of the first + of the coded signal.
In the 60's, after the T1 (T-carrier level 1).
dCode retains ownership of the "Alternate Mark Inversion Code" source code. Any algorithm for the "Alternate Mark Inversion Code" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Alternate Mark Inversion Code" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Alternate Mark Inversion Code" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Alternate Mark Inversion Code" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Alternate Mark Inversion Code on dCode.fr [online website], retrieved on 2025-04-16,