# Gas or vapour amount fraction in air to mass concentration, and back

`calc_gas_concentration` · Runs: On the server · Level: Checked against a reference: exact rational arithmetic, against a second implementation in Python by a separate agent of the same model family; HSE EH40/2005 Table 1 at its printed digits

Converts a gas or vapour's amount fraction in air to its mass concentration, or the reverse.

Research and education software; not medical advice, and not for diagnosis or treatment decisions. It computes from the inputs it receives. It does not check the person's data, design or sample.

[Catalogue](https://www.drybench.com/mcp/catalogue) / [Solutions](https://www.drybench.com/mcp/catalogue/solutions)

[Ask your assistant](https://www.drybench.com/mcp/connect)

```cite
Gas or vapour amount fraction in air to mass concentration, and back (calc_gas_concentration), Drybench MCP server 1.0.0; calc-gas-concentration@1.1.2 (Checked against a reference); https://www.drybench.com/mcp/tools/calc-gas-concentration
```

## What it is

Returns a gas or vapour's mass concentration in air from its amount fraction, or the reverse. The temperature and absolute pressure are stated, never assumed. Use when converting a sensor's µmol/mol reading of CO2, ammonia or a solvent vapour to mg/m³. The amount fraction is by amount: a bare ppm is not accepted. Tables such as NIOSH's use the conventional 24.45 L/mol at 25 °C; this tool uses RT/p exactly. No comparison with an exposure limit is made. Not for pV = nRT: use \`calc\_gas\_law\`.

Field: [Solutions and bench arithmetic](https://www.drybench.com/mcp/catalogue/solutions).

## What it does

**You give**

- `substance` (required): The gas or vapour: a formula or a molar mass.
- `phase` (required): gas or vapour; an aerosol or particulate (particulate) is refused, since it has a mass concentration only.
- `temperature` (required): Temperature of the air. Must be above 0 K.
- `absolutePressure` (required): Absolute pressure of the air. Must be above 0 Pa.
- `amountFraction`: Amount fraction in air, by amount. Must be at least 0 µmol/mol and at most 1000000 µmol/mol. Optional.
- `massConcentration`: Mass concentration in air. Must be at least 0 mg/m^3. Optional.

No request is recorded for this tool.

**Limits**

- Bench arithmetic on solutions you describe.
- Research and education software: it does not look up densities, check that a label is right, or assess hazards.
- Conversion between a gas or vapour's amount fraction in air and its mass concentration, at the temperature and absolute pressure you state, for an ideal, dry gas.
- The amount fraction is by amount, in µmol/mol or nmol/mol: a bare ppm or ppb, or ppm by mass, is not accepted.
- Particulates and aerosols are refused.
- It does not check whether a vapour would condense, and makes no comparison with any exposure limit.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.

**It will not answer when**

- the mass concentration given implies more than one mole of the substance per mole of air at this temperature and pressure.
- not exactly one of the amount fraction and the mass concentration is given.
- the substance is declared an aerosol or particulate, which has a mass concentration only.
- the substance gives both, or neither, of a formula and a molar mass.

### Every input, with its units

6 inputs

- `substance` (required): The gas or vapour: a formula or a molar mass.
- `phase` (required): gas or vapour; an aerosol or particulate (particulate) is refused, since it has a mass concentration only.
- `temperature` (required): Temperature of the air. Must be above 0 K.
- `absolutePressure` (required): Absolute pressure of the air. Must be above 0 Pa.
- `amountFraction`: Amount fraction in air, by amount. Must be at least 0 µmol/mol and at most 1000000 µmol/mol. Optional.
- `massConcentration`: Mass concentration in air. Must be at least 0 mg/m^3. Optional.

### Every refusal, with its code

4 refusals

| Code | When |
| --- | --- |
| `AMOUNT_FRACTION_ABOVE_ONE` | the mass concentration given implies more than one mole of the substance per mole of air at this temperature and pressure. |
| `FORM_COUNT` | not exactly one of the amount fraction and the mass concentration is given. |
| `PARTICULATE` | the substance is declared an aerosol or particulate, which has a mass concentration only. |
| `MOLAR_MASS_SOURCE` | the substance gives both, or neither, of a formula and a molar mass. |

## The calculation

The method's equations, constants and worked example.

### [A gas or vapour's amount fraction in air to its mass concentration and back, at a stated temperature and pressure](https://www.drybench.com/methods/m/calc-gas-concentration/1.1.2)

`calc-gas-concentration@1.1.2`

```text
ρ = x·M/V_m = x·M·p/(R·T)
x = ρ·V_m/M
```

| Symbol | Meaning |
| --- | --- |
| `ρ` | mass concentration of the substance in air, mg/m^3 |
| `x` | amount fraction of the substance (by amount, never by mass), µmol/mol |
| `M` | molar mass of the substance, g/mol |
| `V_m` | molar volume of an ideal gas at the stated temperature and pressure, L/mol |
| `p` | absolute pressure (with R in J/(mol·K), R·T/p comes out in L/mol), kPa |
| `T` | temperature, t in °C + 273.15, K |
| `R` | molar gas constant N\_A·k, exact (calc-gas-law), J/(mol·K) |

Source 1.

| Constant | Value | From |
| --- | --- | --- |
| standard atomic weights (CIAAW abridged), through formula-mass 1.1.0 `A_r` | a table of values, part of the method | Source 2 |

A definition, not a model: the equation states what the quantity means. A different convention gives a different number.

**Worked example**

Worked example: one case of calc-gas-concentration\@1.1.2, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- substance.formula = CO2
- phase = gas
- amountFraction = 1000 µmol/mol
- temperature = 20 degC
- absolutePressure = 101.325 kPa

**Steps**

1. Vm = 24.055117 L/mol, from temperature, absolutePressure; by the equation above; gives molarVolume.
2. rho = 1829.5068 mg/m³, from amountFraction, substance.formula, Vm; by the equation above; gives massConcentration.

The working, as the case writes it:

```text
M(CO2) = 12.011 + 2 x 15.999 = 44.009 g/mol
Vm = 8.31446261815324 x 293.15 / 101325 = 0.0240549 m3/mol
rho = 1000e-6 x 44.009 / 0.0240549 = 1.8295068 g/m3 = 1829.5068 mg/m3 (worked by hand by the raising builder, 14 November 2026)
```

**Answer**

- molarVolume = 24.055117 L/mol
- massConcentration = 1829.5068 mg/m³

Where these values came from: our own exact-arithmetic script and a hand-worked case; the second implementation's run(arguments).

At build the tool returned this answer within the tolerance the file states: every number relative 1e-12 (absolute 1e-15 below 1e-3, in each value's unit); strings, notes, statuses and codes exact; where one path carries more than one unit, or a logarithmic unit, absolute at the relative value times the smallest nonzero magnitude under it (the largest, for a logarithm).

Who worked this case: not recorded.

## Sources

1. Cohen ER et al. Quantities, Units and Symbols in Physical Chemistry (the IUPAC Green Book), IUPAC and RSC Used for: A gas or vapour's amount fraction in air to its mass concentration and back, at a stated temperature and pressure. At: section §2.10, printed p. 48: x\_B = n\_B/Σn\_i, with the ideal-gas molar volume of calc-gas-law; µmol/mol × g/mol ÷ L/mol comes out exactly in mg/m³. **Read in full, 11 November 2026**
2. IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), Abridged Standard Atomic Weights Used for: A gas or vapour's amount fraction in air to its mass concentration and back, at a stated temperature and pressure. At: table Abridged Standard Atomic Weights. **Read in full, 10 November 2026**

Read by AI-assisted sessions. No person has checked these readings.

## How it is checked

**Level:** Checked against a reference.

**Checked against:** Our own exact-arithmetic script and a hand-worked case; the source's own worked example, HSE EH40/2005 Workplace exposure limits, Table 1, 4th edition 2020, web version of the printed edition, read 24 November 2026 (SHA-256 736c6fc0…).

**Cases:** No case set is linked to this version.

**Not checked:** Exposure limits (no comparison is made); EH40/2005 Table 1's carbon monoxide short-term row, whose printed 117 mg.m-3 departs from EH40's own paragraphs 68 and 69 (116), and its molar volume 24.05526 L/mol, which implies R = 8.31451 (an older value; 6e-6 relative from RT/p today); condensation of a vapour; particulates; ppm by mass; humid air; real-gas behaviour. A formula starting with a digit (13NH3) is refused FORMULA\_INVALID since 1.1.2, through formula-mass 1.3.0, with no case in this method's fixtures; the refusal is covered by stored reference values and unit tests only.

No independent scientist has yet reviewed this.

### Changes to its methods

1 change

- [25 November 2026, calc-gas-concentration\@1.1.2](https://www.drybench.com/methods/corrections#2026-11-25-calc-gas-concentration112-1): In 1.1.2, through formula-mass 1.3.0, a formula starting with a digit is now refused (FORMULA\_INVALID); every other output is unchanged, and every pinned output hash is the same.
