Fine-Tuning Dataset Token Estimator
Fine-tuning is usually billed by the tokens the training run processes: the tokens in your dataset times the number of epochs. Enter your number of examples, the average tokens in the system, input and output messages and the epochs, optionally with a price per million training tokens, to estimate the training tokens and cost. You can also paste a small JSONL sample, which is summarised locally in your browser, to fill in the averages.
Result
Estimate
Enter the number of examples and the average tokens to estimate the training tokens.
- Tokens per example
- Dataset tokens (one pass)
- Training tokens (× epochs)
- Cost per epoch
- Estimated total cost
Exact arithmetic on your averages. Averages taken from a sample are estimates, and a provider counts with its own tokenizer, so its billed figure can differ.
Examples
Worked examples (3 or 2 epochs, at an example price of 5 USD per million training tokens):
| Dataset | Examples | Tokens per example | Epochs | Training tokens | Cost at the example price |
|---|---|---|---|---|---|
| Support replies | 500 | 350 | 3 | 525,000 | 2.63 USD |
| Short classification | 10,000 | 85 | 3 | 2,550,000 | 12.75 USD |
| Long-form writing | 2,000 | 1,700 | 2 | 6,800,000 | 34.00 USD |
Fine-tuning price reference
These are the training prices behind this estimator’s presets. They come from the same data the estimator uses, and each row shows the day its value was last compared with the provider’s own pricing page.
Prices are in USD per 1,000,000 (one million) training tokens. Only models that OpenAI bills per training token are listed: some reasoning models bill training by the hour, which a token estimate cannot price.
| Model | Training price | Verified |
|---|---|---|
| gpt-4.1-2025-04-14 | 25.00 USD | |
| gpt-4.1-mini-2025-04-14 | 5.00 USD | |
| gpt-4o-mini-2024-07-18 | 3.00 USD |
Official source: OpenAI API pricing page
How to read these prices
- OpenAI states on its pricing page that it is winding down its fine-tuning platform, which is no longer open to new users. Its deprecations page says active existing customers can no longer create new fine-tuning jobs from 6 January 2027. These prices matter only to organizations that can still train.
- Prices change often. The provider’s own pricing page is always the authority: confirm a price there before you rely on it.
- Training is only part of a fine-tuning cost: using the fine-tuned model is billed separately at its own rates, which are not shown here.
- These figures are for planning. A price you enter yourself in the estimator always takes precedence over a preset.
- ToolQuarter is independent. It is not affiliated with, endorsed by or sponsored by OpenAI; its name is used only to say whose prices are shown.
Official source: OpenAI deprecations page ()
Formula & Methodology
The arithmetic is exact for the numbers you enter:
tokens per example = system + input + output + format overheaddataset tokens = examples × tokens per exampletraining tokens = dataset tokens × epochscost = training tokens × price per million ÷ 1,000,000Good to know
- Providers typically bill training by the tokens processed: your dataset tokens times the epochs. Check your provider’s documentation, because some models bill training by time and some programs change the rate.
- The loss is computed on the assistant output, but billing usually counts every token in the file, including system and input messages.
- Providers tokenize with their own tokenizer and add message formatting, so their count can differ from an estimate. Use the usage figures from a real job for the final number.
- The epochs can be set by you or chosen automatically, and small datasets often get more passes. A validation file adds its own tokens.
- This estimates the training cost only. Running the fine-tuned model afterwards has its own inference prices.
How to Use
- Enter the number of examples and the average system, input and output tokens, or paste a JSONL sample and use its averages.
- Set the epochs and, if you like, a format overhead.
- Optionally enter the price per million training tokens, or prefill it from a preset.
- Read the tokens per example, the dataset and training tokens and the estimated cost.
Frequently Asked Questions
How do I estimate the tokens in a fine-tuning dataset?
Multiply the number of examples by the average tokens per example (system, input and output together). That is one pass over the dataset. Multiply by the epochs to get the training tokens.
How is fine-tuning usually priced?
Most providers charge a price per million training tokens, applied to the tokens in your file times the number of epochs. Some models are billed by training time instead. Always confirm on the provider’s pricing page.
Why does the epoch count matter so much?
Every epoch reprocesses the whole dataset, so tokens and cost scale linearly with it: three epochs cost three times as much as one.
Is my pasted dataset sent anywhere?
No. The sample is parsed and tokenized in your browser, and nothing you paste is uploaded, stored or sent to analytics. Malformed lines are skipped and counted rather than breaking the page.
How accurate is the cost estimate?
The arithmetic is exact, but it is only as good as your averages and price. Sample-based averages are estimates, and a provider counts with its own tokenizer. Use the estimate for planning and the job’s own usage report for the real figure.
Last updated: