Skip to content

Guides

BigQuery query cost calculator

Enter the bytes a query processes, from a dry run or the console, to see its on-demand cost per run and per month at $6.25 per TiB or your own rate, and what a change adds.

Updated · First published

Example: a query that runs 30 times a month and reads 50 GiB, edited so it reads 800 GiB. Replace the numbers with yours.

From a dry run or the console's "This query will process…" line.

The edited query's dry run, to see what your change costs. Clear it to price one query.

Cost per run and per month
Per run Per month
Current $0.305 $9.16
Edited $4.88 $146.48
Change +$4.58 (↑1500%) +$137.33 (↑1500%)

On-demand pricing: bytes ÷ 240 × USD per TiB. Leaves out the free 1 TiB a month and the 10 MB minimums (what BigQuery doesn't charge for).

How much does a BigQuery query cost?#

On-demand pricing, BigQuery's default, charges for the bytes a query processes: $6.25 per TiB on Google's pricing page for Iowa (us-central1), the region the page shows first, and "the first 1 TiB of query data processed per month is free", per account (BigQuery pricing). One run costs bytes processed ÷ 2^40 × the price per TiB, so a query that processes 100 GiB costs about $0.61. The page sets prices per region: enter your region's rate, or a negotiated one, in the calculator above.

At $6.25 per TiB, before the free tier:

Bytes processed per run Cost per run Per month at 30 runs
1 GiB $0.006 $0.183
10 GiB $0.061 $1.83
100 GiB $0.610 $18.31
500 GiB $3.05 $91.55
1 TiB $6.25 $187.50
10 TiB $62.50 $1,875.00

Amounts under $1 show three decimals.

A TiB is 2^40 bytes (1,024 GiB), a little more than a decimal TB (10^12 bytes). The console shows binary units (for example KiB), so pick the same unit in the calculator.

How do I find how many bytes a query processes?#

Run a dry run: BigQuery checks the query and estimates the bytes it would process, and "you are not charged for performing a dry run" (Running queries).

  • In the console, the query editor shows the estimate before you run anything, for example "This query will process 623.1 KiB when run" (Estimate query costs).
  • With the bq tool, add --dry_run. The answer is in bytes:
bq query --use_legacy_sql=false --dry_run \
  'SELECT order_id, amount FROM `my_project.analytics.orders` WHERE order_date = "2026-11-01"'

It answers with a line like "Query successfully validated. Assuming the tables are not modified, running this query will process 10918 bytes of data." (Running queries). Enter that number with the unit bytes.

To see what a change costs, dry-run both versions and enter the current query's size and the edited one's: the calculator's Change row is the difference per run and per month. The percentage is the increase over the current cost: 800 GiB is 16 times 50 GiB, an increase of 1500%.

Clear the edited query's size to price the current query alone. If a field contains an invalid number or makes a cost too large to display, the calculator names the field and shows a dash for the unavailable figures.

What does BigQuery not charge for?#

Google's pricing page lists these for on-demand queries (BigQuery pricing):

  • Queries that return an error, and queries answered from cached results, aren't charged.
  • Charges are rounded up to the nearest MB, with at least 10 MB per table the query references and 10 MB per query. A tiny query therefore costs slightly more than bytes ÷ 2^40 × the price (10 MB at $6.25 per TiB is under $0.0001). The calculator leaves the minimums out.
  • The first 1 TiB processed each month is free, per account. That's a monthly total across every query, so the calculator doesn't subtract it from any one query.

Does LIMIT make a query cheaper?#

Usually not. You're "charged according to the data processed in the columns you select, even if you set an explicit LIMIT on the results" (BigQuery pricing). On a table that isn't clustered, LIMIT "doesn't affect the amount of data that is read"; on a clustered table it can reduce the bytes scanned (Estimate query costs). To read less, select fewer columns and filter on the partitioning column: see Removed partition filters.

Why can my bill differ from the estimate?#

  • Clustered tables: the estimate "is an upper bound" (Estimate query costs), so the bill can be lower.
  • External tables can report "a lower bound of 0 bytes", and tables with row-level security "always return 0 bytes" (Running queries), so a dry run can't price them.
  • The data grows. An estimate is for the tables as they are now; the same query reads more as they grow.
  • Capacity pricing (Editions). BigQuery also offers capacity-based pricing (BigQuery pricing); on it, you aren't billed per TiB a query processes. To compare queries in dollars anyway, work out an effective price per TiB from your slot usage (DiffCost's docs have a query for it) and enter it above.

Can I see this cost on every pull request?#

Yes. DiffCost is a GitHub Action that does this calculation for every changed query or dbt model in a pull request: it dry-runs the base-branch and pull request versions in your BigQuery project and posts the per-run cost change as a comment. The comment is free and needs no DiffCost account, and your SQL never reaches DiffCost. Start with the Quickstart, or read how DiffCost works.

Next steps#

Something missing or wrong? Email support@diffcost.dev.