ForHosting KIT · Science

Gas moles calculator

Count the moles of gas in a vessel: 101325 Pa in 0.022414 m³ at 273.15 K is almost exactly one mole, the classic textbook case at 0 °C and standard pressure. Pressure, volume and temperature are all you need. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Pressure
101,325
Volume
0.022414
Creativity
273.15
You get
Gas constant
8.314462618
Moles
1.0000013588
Product pv
2,271.09855
Product rt
2,271.09546411

The ideal-gas law ties pressure, volume, temperature and amount of substance into one equation: PV equals nRT. When you already know absolute pressure, the volume of the sample and the absolute temperature, rearranging for moles gives the closed form n equals PV divided by RT. Laboratory notebooks, homework sets and process checks all ask that same question in different words—how many moles of gas sit in this vessel—and this calculator answers it with deterministic floating-point arithmetic. Enter pressure, volume and temperature in a consistent unit system (SI defaults are pascals, cubic metres and kelvin with R equal to 8.314462618 joules per mole-kelvin), optionally override the gas constant when you work in litres and atmospheres, and receive moles plus intermediate products for audit. Temperature zero or negative is rejected so a non-physical division never becomes a silent bad number.

How ideal-gas moles relate to pressure, volume and temperature

Start from the ideal-gas law written as PV equals nRT, where P is absolute pressure, V is the volume occupied by the gas, n is the amount of substance in moles, R is the universal gas constant and T is absolute temperature in kelvin. Solving for n produces the product formula this capability evaluates: n equals P times V divided by R times T.

Keep pressure, volume, temperature and R on a mutually consistent unit system so the quotient lands in moles without hidden conversion factors—SI pairs pascals, cubic metres and kelvin with R equal to 8.314462618 joules per mole-kelvin; a common classroom alternative uses atmospheres, litres and kelvin with R near 0.08205746 litre-atmospheres per mole-kelvin. Zero or negative pressure or volume is likewise rejected for a free gas-sample path. Callers who only know Celsius must convert to kelvin before calling, because the ideal-gas law is defined on the absolute temperature scale.

Where gas-moles-from-PTV calculators show up in real work

Secondary-school and introductory university chemistry courses assign ideal-gas drills that convert measured pressure, flask volume and bath temperature into moles before stoichiometry or limiting-reagent tables; a single trusted oracle speeds grading and demo setup without hand-waving floating-point noise. Analytical and process labs size vessel inventories when a reactor holds a known absolute pressure over a measured free volume at a controlled temperature and the next step consumes a fixed mole amount of gas.

Environmental and industrial hygiene checks convert room-temperature bag samples into moles for concentration work when molar mass and total volume are known separately. If you later need molar volume from P and T alone, gas density from molar mass, moles from molarity and solution volume, real-gas equations of state, or automatic Celsius-to-kelvin conversion inside the form, treat those as separate search intents and landings rather than overloading this gas-moles-from-pressure-volume-temperature calculator page.

Homework and lab answer keys

Compute moles n = PV/RT from absolute pressure, volume and kelvin temperature so students and auto-graders share one closed-form ground truth.

Vessel inventory and reactor prep

Convert measured P, V and T into moles of ideal gas before stoichiometry, dosing or headspace balance calculations.

Sample-bag and process checks

Estimate moles in a collected gas sample from absolute pressure, sample volume and absolute temperature with a consistent R.

How do I calculate moles of an ideal gas from P, V and T?

Use n = P·V/(R·T). Enter absolute pressure, volume and absolute temperature in a consistent unit system; optionally set R (default SI 8.314462618 J/(mol·K)). The result is the amount of gas in moles.

What happens if temperature is zero or negative?

Absolute temperature must be greater than zero because n = PV/RT is undefined or non-physical at absolute zero and below.

Which units should I use?

Any consistent set. For L and atm, supply a matching R such as 0.08205746 L·atm/(mol·K).

What does it cost?

The browser tool is free and runs locally.

What if my temperature is in degrees Celsius?

Convert it to kelvin before you enter it, because the ideal gas law works on the absolute scale; 0 °C, for example, is 273.15 K. Entering a Celsius value directly gives the wrong number of moles.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/chem/gas-moles-from-ptv

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/chem/gas-moles-from-ptv \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pressure":101325,"volume":0.022414,"temperature":273.15}'
{
  "pressure": 101325,
  "volume": 0.022414,
  "temperature": 273.15
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "chem.gas_moles_from_ptv",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

No network, no random seeds, and no wall-clock timestamps: identical inputs always produce identical JSON.

How ideal-gas moles relate to pressure, volume and temperature

Absolute temperature zero or negative makes the denominator vanish or go non-physical, so T less than or equal to zero fails validation with a clear invalid_input message rather than a silent Infinity or NaN. This capability evaluates the closed form in deterministic floating-point arithmetic: no random seeds, no wall-clock timestamps, no network calls, and no model drift, so identical inputs always produce identical JSON. It does not compute molar volume alone, gas density from molar mass, partial pressures in mixtures, real-gas compressibility factors, or automatic unit conversion from millilitres and bar; those are separate search intents with their own landings when product coverage grows.

What you send and what you get back

Classic textbook checks include roughly one mole of ideal gas near standard pressure and zero Celsius in about twenty-two point four litres when R and units are chosen consistently. Keep absolute temperature on the kelvin scale across multi-step lab pipelines so the numeric quotient still matches the mole amount your report claims. Send three required finite numbers under the fields pressure, volume and temperature, and optionally gas_constant when you are not using the SI default. pressure is absolute pressure and must be greater than zero. volume is the gas sample volume and must be greater than zero; convert litres to cubic metres by dividing by one thousand when pairing with SI R. temperature is absolute temperature in kelvin and must be greater than zero—temperature zero or negative fails with invalid_input as required by the physical model. gas_constant is optional and defaults to 8.314462618 joules per mole-kelvin; when you supply it, it must also be a finite positive number matching your chosen unit system. Missing fields, non-numeric strings, NaN, Infinity, non-positive pressure or volume, and non-positive R fail with invalid_input and are not charged. On success the response echoes cleaned pressure, volume, temperature and gas_constant, sets gas_constant_defaulted to true when the SI default was used, provides moles as the primary result, includes product_pv and product_rt intermediates for homework write-ups, attaches a units hint object, sets method to ideal_gas_moles_from_ptv, and formula to n equals P·V/(R·T). Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where gas-moles-from-PTV calculators show up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Is the gas constant required?

No. When omitted, the calculator uses SI R = 8.314462618 J/(mol·K) and sets gas_constant_defaulted to true in the response.

Read the full KIT documentation →