Charles's law calculator
2 litres of gas at 300 K warmed to 600 K expands to 4 litres, because volume over kelvin temperature stays constant at fixed pressure. Give V1, T1 and either the final volume or the final temperature. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- V1
- 2
- T1
- 300
- T2
- 600
- V2
- 4
- Solved
- v2
- Ratio
- 0.0066666667
- Law
- V1/T1 = V2/T2
Charles's law states that for a fixed amount of gas at constant pressure, volume and absolute temperature stay proportional: V1 divided by T1 equals V2 divided by T2. This calculator takes the initial volume and temperature in kelvin, plus exactly one of the final volume or final temperature, and returns the missing final value with the full V1, T1, V2, T2 set so you can check the ratio yourself. Absolute zero (zero kelvin) is rejected because the law is defined only for positive absolute temperatures, and volumes must be positive so the proportions stay physically meaningful for ideal-gas style classroom and lab work.
What Charles's law solves and when it applies
Charles's law is one of the classical gas laws used in chemistry and physics when pressure and the amount of gas are held fixed while volume and temperature change together. In symbolic form it is V over T equals a constant, or more usefully for calculation V1 over T1 equals V2 over T2. Volume can use any consistent unit — liters, milliliters, or cubic meters — as long as both volumes share that unit; the capability does not convert units, it only applies the proportion.
The pressure is assumed constant by construction; if pressure also changes you need the combined gas law or the ideal-gas equation instead of this specialized solver.
Classroom labs, process checks, and automation tips
Process engineers can script batch checks when a vessel is warmed on a schedule and pressure relief is designed so pressure stays near constant, estimating the volume change that seals or flexible volumes must absorb. Prefer kelvin throughout your pipeline: store sensor Celsius only at the edge, convert once, then call this capability. Never pass absolute zero or leave both final fields empty.
When you need Boyle's law (pressure-volume at fixed temperature) or Gay-Lussac (pressure-temperature at fixed volume), use a dedicated law calculator rather than stretching Charles's law beyond constant pressure. Keep examples in documentation with round numbers such as V1 equals 2, T1 equals 300 K, T2 equals 600 K so reviewers can verify V2 equals 4 by inspection.
What you can do with it
Predict gas expansion after heating
Given a known initial volume and temperature, supply the planned final temperature to obtain the final volume at constant pressure before a lab heat step.
Back-calculate temperature from volume change
When a flexible container grows from V1 to V2, solve for the absolute temperature T2 implied by Charles's law under constant pressure.
FAQ
What is Charles's law in this calculator?
At constant pressure, V1/T1 = V2/T2 with temperatures in kelvin. Provide V1, T1, and either V2 or T2; the service returns the missing final value and the full set of four quantities.
Why must temperature be in kelvin?
Charles's law is a proportion of absolute temperature. Celsius or Fahrenheit zero points are not absolute zero; zero kelvin is rejected because the law is not defined there for this tool.
Can I send both V2 and T2?
No. Exactly one final value must be provided so the other can be solved.
Does pressure need to be entered?
No. Charles's law assumes pressure is held constant; pressure is not an input. If pressure changes, use a different gas-law relation.
Can I find the final temperature instead of the volume?
Yes. Enter the final volume instead of the final temperature and the calculator solves T2 as T1 times V2 divided by V1, in kelvin. Give only one of the two final values.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/thermo/charles-law \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"v1":2,"t1":300}'const res = await fetch("https://api.kit.forhosting.com/thermo/charles-law", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"v1": 2,
"t1": 300
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/thermo/charles-law",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"v1": 2,
"t1": 300
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/thermo/charles-law", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"v1":2,"t1":300}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"v1":2,"t1":300}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/thermo/charles-law", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"v1": 2,
"t1": 300
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "thermo.charles_law",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What Charles's law solves and when it applies
Temperatures must be absolute: convert Celsius to kelvin by adding 273.15 before you call the endpoint, because a zero or negative kelvin input is not a valid absolute temperature for this relation. Use this tool when you know three of the four quantities and need the fourth final value, for example expanding a balloon as temperature rises, sizing a piston chamber after a temperature step, or checking a homework result against a deterministic API instead of a spreadsheet formula you might mistype.
How to call the calculator and read the result
Send an object with v1 and t1 required, and exactly one of v2 or t2. If you supply t2, the service solves for v2 as v1 times t2 divided by t1. If you supply v2, it solves for t2 as t1 times v2 divided by v1. The JSON response echoes all four scalars, names which field was solved, returns the V1/T1 ratio for audit, and labels the law and the constant-pressure assumption so downstream code does not have to hard-code documentation strings. Invalid combinations fail with invalid_input and are not charged: missing both finals, providing both finals, non-finite numbers, non-positive volume, or zero or negative kelvin. That strict gate keeps automated pipelines honest — a bot that forgets units or passes Celsius as if it were kelvin will see a clear error rather than a silently wrong expansion.
Classroom labs, process checks, and automation tips
In teaching labs, students often measure initial volume at room temperature and then heat the gas at roughly constant pressure; plugging measured V1, T1, and T2 into this endpoint yields the predicted V2 for comparison with the graduated cylinder or syringe reading.
Integration use cases
Automate homework and quiz checks
Call the API from a grading script with three known values and compare the solved field to student answers without maintaining a separate formula sheet.
Technical questions
How much does the API cost?
Successful calls are billed at $0.002 per item from your prepaid KIT balance. Failed invalid_input requests are not charged. The browser widget runs the same solver free for interactive use.