> For the complete documentation index, see [llms.txt](https://docs.labii.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.labii.com/widgets/section-widgets/chemistry/chemical-analysis/molecular-formula-analysis.md).

# Molecular Formula Analysis

## Specs

| Label                     | Value                         |
| ------------------------- | ----------------------------- |
| **Version**               | 1.0.0 (updated on 2022-08-12) |
| **Developer**             | Labii Inc.                    |
| **Type**                  | Section                       |
| **Support Configuration** | No                            |

## Overview

The Molecular Formula Analysis widget analyzes a user-provided molecular formula and displays the calculated composition in a structured table. It uses the [chemcalc](https://www.npmjs.com/package/chemcalc) engine to return the molecular formula, molecular weight, monoisotopic mass, and an elemental breakdown that includes each element, its count, percentage contribution, and molecular part. This widget is useful for chemistry, formulation, and compound registration workflows where users need a quick composition check directly inside a Labii record.

## Use Cases

* **Compound Verification**: Confirm that a proposed molecular formula matches the expected elemental composition before recording or sharing a compound.
* **Analytical Review**: Review molecular weight and monoisotopic mass during compound characterization or pre-analysis checks.
* **Formulation Support**: Compare element counts and percentages when evaluating salts, hydrates, or multi-part formulas.
* **Registration Workflows**: Store formula analysis results alongside compound registration records for downstream review.
* **Educational and Training Records**: Help students or new team members understand how a molecular formula maps to elemental composition.

## Interface

### Read-only View

In read-only mode, the widget displays the analysis result for the saved molecular formula. The top of the section shows summary values for the formula, molecular weight, and monoisotopic mass. Below the summary, the widget lists the elemental composition in a table with the following fields:

* **Element**: The chemical element symbol.
* **Number**: The number of atoms of that element in the formula.
* **Percentage**: The mass percentage contributed by that element.
* **Part**: The molecular part associated with that element when the formula contains multiple parts.

This layout makes it easy to inspect both the overall molecular properties and the per-element contribution without opening any external chemistry software.

<figure><img src="/files/hsYcvlv7hDP8ZQiAKZrO" alt="Read-only view of the Molecular Formula Analysis widget showing calculated formula properties and elemental composition"><figcaption><p>The read-only view displays the molecular formula summary together with the elemental composition table.</p></figcaption></figure>

### Edit View

In edit mode, users enter a molecular formula and run the analysis directly in the widget.

* **Formula Input**: Enter the molecular formula to analyze, such as `C6H12O6`.
* **Analysis Action**: Click the **Analysis** button to calculate the result.
* **Calculated Summary**: The widget returns the following summary fields:
  * **Molecular Formula**
  * **Molecular Weight**
  * **Monoisotopic Mass**
* **Element Table**: The widget also generates a table containing:
  * **Element**
  * **Number**
  * **Percentage**
  * **Part**

The edit workflow is intentionally simple: provide a valid formula, run the analysis, and save the resulting output as part of the record.

## Configuration

The Molecular Formula Analysis widget does not provide any settings or configuration options. It is ready to use immediately after being added to a section.

{% hint style="info" %}
Because the widget has no configuration, every instance uses the same analysis logic and output structure across all records.
{% endhint %}

## Additional Functions

### Analyze a Molecular Formula

{% stepper %}
{% step %}
Open the record and click **Edit** on the Molecular Formula Analysis section.
{% endstep %}

{% step %}
Enter a valid molecular formula in the input field.
{% endstep %}

{% step %}
Click **Analysis** to calculate the result.
{% endstep %}

{% step %}
Review the returned summary values for **Molecular Formula**, **Molecular Weight**, and **Monoisotopic Mass**, then inspect the element table for **Element**, **Number**, **Percentage**, and **Part**.
{% endstep %}

{% step %}
Save the record to preserve the analysis result.
{% endstep %}
{% endstepper %}

### Output Fields

The widget displays the following fields for each analysis result:

* **Formula**: Molecular Formula
* **Weight**: Molecular Weight
* **Mass**: Monoisotopic Mass
* **Element**: Element symbol in the composition table
* **Number**: Atom count for each element
* **Percentage**: Relative mass percentage for each element
* **Part**: Molecular part identifier for formulas with multiple parts

## Best Practices

### Formula Entry

* Enter formulas using standard chemical notation so the parser can interpret the composition correctly.
* Double-check capitalization for element symbols, since `Co` and `CO` represent different chemistry.
* Use the widget for molecular formulas rather than reaction strings or free-text chemical descriptions.

### Result Review

* Review both **Molecular Weight** and **Monoisotopic Mass** when documenting compounds for analytical workflows, as the two values serve different purposes.
* Inspect the **Percentage** column when comparing related compounds, salts, or hydrates.
* Use the **Part** column to understand formulas that contain multiple molecular components.

### Record Quality

* Save the analysis result together with the source compound record so future reviewers can trace how the composition was documented.
* Re-run the analysis after any formula change instead of manually editing the output values.

{% hint style="success" %}
Use this widget when you need a fast, repeatable molecular composition check directly inside Labii without switching to a separate chemistry calculator.
{% endhint %}

## Related Widgets

* [**Ketcher**](/widgets/section-widgets/chemistry/chemical-drawing/ketcher.md): Draw chemical structures and calculate molecular properties from a structure editor.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.labii.com/widgets/section-widgets/chemistry/chemical-analysis/molecular-formula-analysis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
