What Is InChI and How Do You Use It to Identify or Search for Chemical Structures?
Updated
InChI (International Chemical Identifier) is a text string that encodes a chemical structure in a standardized, layered format, so the same compound always produces the same identifier regardless of which software generated it. You use it to confirm that two records describe the same molecule, to move a structure between databases without drawing it, and to search structure databases such as ChemSpider by pasting the string into a search box. It works best as an exact-identity check; if you only need a rough structure sketch or a quick lookup, SMILES or a name search is often faster.
What an InChI string actually encodes
An InChI is built from layers, each separated by a slash, and each layer adds one kind of structural information. Reading the layers in order tells you what the identifier is claiming about the molecule.
| Layer | Prefix | What it captures |
|---|---|---|
| Formula | (none) | Molecular formula, e.g. C2H6O |
| Connections | c |
How atoms are bonded (the skeleton) |
| Hydrogens | h |
Hydrogen positions on the skeleton |
| Charge | q / p |
Net charge and protonation state |
| Stereochemistry | t, m, s |
Tetrahedral, double-bond, and type-of-stereo flags |
| Isotopes | i |
Isotopic substitution |
| Fixed H | f |
Tautomer-specific hydrogens |
| Reconnected | r |
Alternative bonding interpretation |
A simple example: ethanol is InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3. The 1S prefix marks the InChI version and standard form. The formula layer says C2H6O, the c layer gives the C–C–O connectivity, and the h layer places the hydrogens. Because the layers are ordered and standardized, two software packages that both follow the standard will produce the same string for the same structure.
The practical consequence: an InChI is a structure-derived identifier, not a registry number. It is not assigned by a database and does not change when a vendor renames a product. That is what makes it useful for cross-referencing.
InChI vs. InChIKey vs. SMILES
These three are often confused because all are text representations of structures, but they serve different purposes.
| InChI | InChIKey | SMILES | |
|---|---|---|---|
| Format | Layered, human-readable string | Fixed 27-character hash (14-10-1 with hyphens) | Compact connection table |
| Readable? | Yes, layers are interpretable | No, it is a hash | Somewhat, for small molecules |
| Uniqueness | Standardized per structure | One key per InChI | Depends on the toolkit that wrote it |
| Best for | Full structure identity, including stereo and charge | Database indexing, fast exact-match lookup | Drawing input, substructure queries, quick sharing |
| Searchable in databases | Yes, as a structure query | Yes, as an exact-match key | Yes, usually as a structure query |
Use InChI when you need the full, verifiable structure record, including stereochemistry and charge. Use InChIKey when you need a short, fixed-length token for matching or indexing, since it is easier to store and compare and does not contain characters that break URLs. Use SMILES when you are feeding a structure into a drawing tool or running a substructure search, because SMILES supports query features that InChI does not.
A key limitation: InChIKey is a hash, so it cannot be reversed back into a structure. If you only have the key, you still need a database to retrieve the full record.
How to search a structure database by InChI or InChIKey
The workflow is the same across most structure databases, including ChemSpider:
- Get the string. Copy the full InChI (including the
InChI=1S/prefix) or the InChIKey from a paper, a vendor page, or another database record. - Open the search interface. On ChemSpider, the search area accepts text and structure input; InChI and InChIKey are listed among the supported identifier types.
- Paste and submit. Paste the string into the search field and run the search.
- Verify the result. Check that the returned record's formula, charge, and stereochemistry match what you expected. Do not assume a hit is correct just because the search returned something.
- Cross-check if needed. If the database returns no match, try the InChIKey alone, or convert the InChI to SMILES with a toolkit and search by structure.
The expected result of a successful InChI search is a single structure record (or a small set of records that share the same structure but come from different data sources). ChemSpider aggregates structures from hundreds of sources, so the same compound may appear under multiple vendor or reference entries.
Verifying that two InChIs are the same compound
Two InChIs match only if every layer matches. This is stricter than it sounds, and it is where most confusion happens.
- Stereochemistry matters. A molecule and its enantiomer have identical formula, connection, and hydrogen layers but differ in the
/tor/mlayer. If you strip the stereo layers, you get a different (non-stereospecific) InChI that will match both. - Charge and protonation matter. The
/qand/players distinguish a neutral molecule from its ionized form. A search for the neutral InChI will not return the salt or the charged species. - Tautomers can differ. Standard InChI normally normalizes some tautomers, but the fixed-H layer (
/f) exists precisely to pin down a specific tautomer. If two records disagree on the fixed-H layer, they are being treated as different forms.
Practical rule: compare layer by layer, not just the first few characters. If the formula and connection layers match but the stereo layer differs, you are looking at stereoisomers, not the same compound.
Why an InChI search fails and how to troubleshoot
| Symptom | Likely cause | Fix |
|---|---|---|
| No results at all | String was truncated or the prefix was dropped | Re-copy the full string, including InChI=1S/ |
| Results for the wrong compound | Pasted the InChIKey of a different record, or mixed up two strings | Re-check the source; search by InChIKey separately |
| No match for a known compound | Database does not contain that exact stereo or charge form | Search the non-stereo or neutral form, or search by SMILES |
| Match but wrong stereochemistry | The database record lacks stereo layers | Confirm the record's stereo assignment before using it |
| InChIKey search returns nothing | Key was copied with a line break or wrong hyphenation | Re-enter the 27-character key in the 14-10-1 format |
A common real-world case: you copy an InChI from a paper's supporting information, but the PDF has wrapped the string across two lines. The pasted result is a valid-looking but incomplete InChI, and the search returns nothing. Re-joining the line usually fixes it.
When to reach for InChI and when not to
Use InChI when you need an unambiguous, software-independent structure identity, when you are cross-referencing the same compound across databases, or when you need to confirm stereochemistry and charge. Use InChIKey when you need a compact exact-match token for indexing or deduplication. Use SMILES when you are drawing, running substructure searches, or working inside a cheminformatics toolkit. And if you only have a common name, start with a name or synonym search first, then confirm the hit with its InChI rather than the other way around.