Home / Science and Engineering / Compression Calculator

Compression Calculator – Engine Ratio or File Ratio, Kept Clearly Apart

Compression means two different things, so this page keeps them in two separate tabs. Use the engine tab for swept and clearance volume, or the file tab for original and compressed size. The two ratios are never mixed.

Two separate modesEngine ratio and file ratioFree, no sign-up

Engine volumes

Cylinder volumes
Swept volume (cc)
Clearance volume (cc)

Formula: compression ratio = (swept volume plus clearance volume) divided by clearance volume. Both volumes must be in the same unit, so the unit cancels and the ratio is unit free.

Private by design: every number is worked out in your browser. Nothing you type is sent anywhere or stored.

File sizes

Sizes in the same unit
Original size (MB)
Compressed size (MB)

Formulas: compression ratio = original size divided by compressed size. Space saved = (1 minus compressed divided by original) times 100. Both sizes must be in the same unit, so megabytes, gigabytes, or kilobytes all work as long as they match.

Private by design: every number is worked out in your browser. Nothing you type is sent anywhere or stored.

Engine result

Compression ratio
11.0:1
For 500 cc swept and 50 cc clearance volume.
Total cylinder volume550.00 cc
Clearance share of total9.09%
Swept share of total90.91%
Copied

File result

Compression ratio
4.0:1
For 100 MB original and 25 MB compressed size.
Space saved75.00 MB
Space saved percent75.00%
Compressed share of original25.00%
Copied
Key Takeaways
  • Engine ratio is (swept plus clearance) divided by clearance: 500 cc and 50 cc give 11.0:1.
  • File ratio is original divided by compressed: 100 MB to 25 MB gives 4.0:1 with 75.00% saved.
  • The two tabs never mix and both numbers in a tab must use the same unit, or the ratio is wrong by the unit factor.

What changes when one number moves

These tables follow your current inputs. On the engine side, a smaller clearance volume raises the ratio fast. On the file side, a smaller compressed size raises both the ratio and the space saved.

Engine: clearance volumeRatioFile: compressed sizeRatio and saved
40 cc13.5:110 MB10.0:1, 90.00% saved
50 cc11.0:125 MB4.0:1, 75.00% saved
60 cc9.3:150 MB2.0:1, 50.00% saved
80 cc7.3:175 MB1.3:1, 25.00% saved

Engine table uses your current swept volume. File table uses your current original size. Change an input above and both tables update.

How it works

Step 1. Pick the right tab: engine for cylinders, file for data. The two ratios use different inputs and must not be swapped.
Step 2. Enter both numbers in the same unit: cubic centimetres for the engine tab, and matching size units for the file tab.
Step 3. Read the ratio, then the supporting figures: total volume for engines, space saved for files.

Compression, explained

At bottom dead centre the cylinder holds swept volume plus clearance volume. At top dead centre only the clearance volume remains. Dividing the largest volume by the smallest gives the compression ratio, so 500 cc swept plus 50 cc clearance is 550 divided by 50, which is 11.0:1.

File ratio is original divided by compressed. If the compressed file is larger than the original, the ratio drops below 1 and space saved goes negative, which means compression added overhead instead of saving space. That happens with already compressed data such as photos and videos.

Engine ratio: why a small clearance change moves the ratio so much

The engine ratio has a property that surprises first-time readers: the clearance volume, the smaller number, controls the ratio far more than the swept volume, the larger number. The formula explains why: the ratio is the total cylinder volume, swept plus clearance, divided by clearance volume, so clearance appears in both the top and the bottom of the fraction, while swept appears only on top. Halving the clearance nearly doubles the ratio, while doubling the swept volume raises it by far less. The page’s own comparison table, driven by the default swept volume of 500 cc, shows the effect across four clearance volumes: 40 cc gives 13.5:1, 50 cc gives 11.0:1, 60 cc gives 9.3:1, and 80 cc gives 7.3:1. Every figure in this section was read from the calculator’s own displayed results for the stated inputs, with the table figures confirmed by direct probes at 40 cc and 80 cc.

Work the two probed cases in full, because the supporting figures explain the ratio better than the ratio alone. At 40 cc clearance, the total cylinder volume is 540.00 cc, the clearance share of the total is 7.41 percent, the swept share is 92.59 percent, and the ratio is 13.5:1. At 80 cc clearance, the total is 580.00 cc, the clearance share is 13.79 percent, the swept share is 86.21 percent, and the ratio is 7.3:1. Doubling the clearance from 40 to 80 cc nearly doubled the clearance share, from 7.41 to 13.79 percent, and nearly halved the ratio, from 13.5:1 to 7.3:1, even though the swept volume never changed. The ratio is, to a close approximation, the reciprocal of the clearance share: a clearance share of 7.41 percent corresponds to a ratio of about 13.5, and a share of 13.79 percent corresponds to a ratio of about 7.3, because the ratio is total divided by clearance, which is 100 divided by the clearance percentage. That reciprocal relationship is the quickest mental check on any engine ratio: if the clearance share looks small, the ratio must look large, and vice versa.

The default case sits in the middle of the table and is the anchor for the whole engine side: 500 cc swept and 50 cc clearance give a total of 550.00 cc, a clearance share of 9.09 percent, a swept share of 90.91 percent, and a ratio of 11.0:1. That ratio sits inside the range the base FAQ gives for most road car petrol engines, 9:1 to 12:1, while many diesel engines run much higher, often 15:1 to 20:1. The page reports the ratio only and does not recommend one, as the base FAQ says, because the right ratio depends on fuel, engine design, and forced induction, and a ratio that is correct for one engine is wrong for another. Use the calculator to find what ratio a given pair of volumes produces, and use the engine’s own specification, not this page, to judge whether that ratio is right for the engine in question.

Clearance volume (swept 500 cc)Total volumeClearance shareSwept shareRatio
40 cc540.00 cc7.41%92.59%13.5:1
50 cc (default)550.00 cc9.09%90.91%11.0:1
60 cc560.00 cc10.71%89.29%9.3:1
80 cc580.00 cc13.79%86.21%7.3:1

The 60 cc row in that table was taken from the page’s own comparison table, which lists 9.3:1, and its shares are arithmetic from the same volumes: 60 divided by 560 is 10.71 percent clearance, leaving 89.29 percent swept. Those two share figures are labelled here as arithmetic on the stated volumes, not as separate calculator displays, while the 40 cc and 80 cc rows, and the default row, are fully probed displays. The distinction matters for the same reason it mattered on earlier pages in this program: a figure the calculator displayed and a figure derived from its inputs are both useful, but they must not be confused, and the derived ones must say so. In this table, only the 60 cc shares carry that label, and every other figure is a displayed result.

Units cancel on the engine side, which is why the page asks for both volumes without a unit selector: the ratio is unit free, because both volumes must be in the same unit, so the unit divides out. Cubic centimetres, litres, or cubic inches all give the same ratio, as long as both volumes use the same unit, and mixing units is the one error that breaks the result silently: a swept volume in cubic centimetres against a clearance volume in litres gives a ratio wrong by a factor of 1,000, with no warning, because the page cannot know which unit each number is in. Convert both volumes to the same unit before typing, and read the total volume line as a check: the total must be slightly larger than the swept volume, by exactly the clearance volume, so a total that is wildly larger or smaller than the swept volume signals a unit mix-up immediately.

File ratio: ratio, space saved, and the file that grew

The file side has three numbers for every case, and they describe the same result in three ways, so learning to convert between them is the whole skill. The ratio is original divided by compressed. The space saved is original minus compressed, in the same unit. The space saved percent is the space saved divided by the original, times 100. The compressed share of the original is compressed divided by original, times 100, and it is the complement of the space saved percent: the two percentages always add to 100. The default case shows all five figures at once: a 100 MB original compressed to 25 MB gives a ratio of 4.0:1, a space saved of 75.00 MB, a space saved percent of 75.00 percent, and a compressed share of 25.00 percent. Every figure in this section was read from the calculator’s own displayed results for the stated inputs.

Scaling both sizes leaves the ratio and both percentages unchanged, while the space saved scales with the sizes, and the probed 1000 MB case proves it. A 1000 MB original compressed to 250 MB gives the same ratio of 4.0:1, the same 75.00 percent saved, and the same 25.00 percent share, but a space saved of 750.00 MB instead of 75.00 MB. That is the unit-free property of ratios in action: the ratio describes the proportion, not the size, so a 4.0:1 compression on a small file and on a large file are the same compression, differing only in the absolute saving. It is also why mixing units breaks the result: a 1 gigabyte original entered as 1 against a 500 megabyte compressed file entered as 500 gives a ratio of 0.0:1 in raw numbers, which is nonsense, while converting the gigabyte to 1000 megabytes first gives 1000 against 500, a ratio of 2.0:1. The base FAQ states the rule plainly: both sizes must use the same unit, or the ratio will be wrong by a factor of about 1,000, and converting one size first is the remedy.

OriginalCompressedRatioSpace savedSaved percentCompressed share
100 MB25 MB4.0:175.00 MB75.00%25.00%
1000 MB250 MB4.0:1750.00 MB75.00%25.00%
100 MB100 MB1.0:10.00 MB0.00%100.00%
100 MB150 MB0.7:1-50.00 MB-50.00%150.00%

The last two rows of that table are the cases most readers misread, so they deserve separate statements. A 100 MB file that compresses to 100 MB gives a ratio of 1.0:1, zero space saved, zero percent saved, and a compressed share of 100 percent: compression did nothing, neither saving nor costing anything. A 100 MB file that compresses to 150 MB gives a ratio of 0.7:1, a space saved of minus 50.00 MB, a saved percent of minus 50.00 percent, and a compressed share of 150.00 percent: compression made the file bigger, by half its original size, and the negative signs are the signal, not an error. The base guide explains why that happens: already compressed formats such as JPEG photos, MP4 video, and ZIP archives have little redundancy left to remove, and the archive headers can add more bytes than compression saves. A ratio below 1 and a negative space saved are the page’s way of saying the compression attempt cost space, and the correct response is to keep the original, not to compress harder, because a second compression pass on an already compressed file will usually add more overhead, not remove it.

Ratio and space saved percent are two descriptions of the same result, and converting between them is a one-line exercise worth learning. A ratio of 4.0:1 means the compressed file is one quarter of the original, so the saved percent is 75. A ratio of 2.0:1 means the compressed file is one half, so the saved percent is 50. A ratio of 1.0:1 means no change, so the saved percent is 0. In general, the saved percent is 100 times one minus one over the ratio, and the ratio is one divided by one minus the saved fraction. The page shows both figures for every case, so no conversion is needed in practice, but knowing the relationship lets you sanity-check a result at a glance: a ratio of 4.0:1 with a saved percent of 25 would be inconsistent, because 4.0:1 must pair with 75 percent, and any pairing that violates the relationship signals a mistyped size. Read the ratio and the percent together, and let each one check the other.

Two tabs, two ratios, never mixed

The page keeps the engine tab and the file tab separate, with separate inputs, separate results, and separate tables, and that separation is a design decision worth respecting, because the two ratios share a name and nothing else. The engine ratio divides a total volume by a clearance volume, and it is always greater than 1, since the total always exceeds the clearance. The file ratio divides an original size by a compressed size, and it can be greater than 1, equal to 1, or less than 1, depending on whether compression saved, did nothing, or cost space. The engine ratio describes a physical geometry, the file ratio describes a data transformation, and no number from one tab belongs in the other. The base guide states the rule in one line: the two ratios are never mixed, and the page enforces it by keeping the tabs’ inputs apart, so a swept volume typed into the file tab is simply a file size, not an engine volume, and the result it produces is a file ratio, not an engine ratio.

What each ratio does not say is as important as what it does, and the page’s own disclaimer draws both boundaries. Engine ratios are planning figures only and do not account for real combustion chamber shape, gasket thickness, or piston deck height unless those are already included in the clearance volume, so a ratio computed from nominal volumes is an approximation to the built engine’s ratio, not a measurement of it. File ratios describe size only and say nothing about quality loss in lossy formats, so a high file ratio achieved by discarding data is not comparable with the same ratio achieved losslessly, and a file ratio alone never tells you whether the compressed file is still fit for its purpose. Use each tab for what it measures, volume geometry or data size, and judge everything else, engine suitability or file quality, from sources that measure those things, not from a ratio that was never designed to.

Checking a ratio by hand, on both tabs

Both ratios are one-division calculations, which makes hand-checking fast and reliable. On the engine side, add swept and clearance, then divide by clearance: 500 plus 50 is 550, divided by 50 is 11.0, so the ratio is 11.0:1. For the 40 cc case, 500 plus 40 is 540, divided by 40 is 13.5, so the ratio is 13.5:1. For the 80 cc case, 500 plus 80 is 580, divided by 80 is 7.25, which the page displays as 7.3:1, rounded to one decimal place. That rounding is the only place where a hand check and the display can differ on the engine side, and it is a display rounding, not a different calculation: the underlying value is 7.25, the display shows 7.3, and any hand value within a tenth of the display agrees with the page. If a hand ratio differs by more than a tenth, the volumes were mistyped, mixed in units, or entered in the wrong tab.

On the file side, divide original by compressed for the ratio, subtract for the space saved, and divide the saving by the original for the percent: 100 divided by 25 is 4.0, so the ratio is 4.0:1; 100 minus 25 is 75, so the space saved is 75.00 MB; 75 divided by 100 is 0.75, so the saved percent is 75.00 percent. For the grown-file case, 100 divided by 150 is 0.667, displayed as 0.7:1; 100 minus 150 is minus 50, so the space saved is minus 50.00 MB; minus 50 divided by 100 is minus 0.50, so the saved percent is minus 50.00 percent. The rounding on the file ratio is again to one decimal place, so a hand value of 0.667 against a display of 0.7:1 is agreement, not disagreement. Check the space saved and the percent as well as the ratio, because the three figures constrain each other, and a mistyped size will usually break at least one of the three relationships visibly.

A last habit applies to both tabs equally: read the supporting figures before the headline ratio, because they catch the errors the ratio hides. On the engine side, read the total volume and the two shares: the total must equal swept plus clearance, and the shares must add to 100 percent. On the file side, read the space saved and the compressed share: the saved percent and the share must add to 100 percent, and the space saved must equal original minus compressed. Those addition checks take seconds, they use only the displayed figures, and they catch unit mix-ups, mistyped digits, and wrong-tab entries that a single ratio figure would let through. A ratio quoted with its supporting figures checked is a ratio worth trusting; a ratio quoted alone is a number waiting to be doubted.

What the engine ratio leaves out, and what the file ratio leaves out

An engine ratio computed from swept and clearance volumes is exact for the volumes entered, and approximate for the engine built, because the built engine’s true clearance volume includes details the nominal volumes may omit. The page’s own disclaimer names three: real combustion chamber shape, gasket thickness, and piston deck height, unless those are already included in the clearance volume you entered. Each of those details changes the clearance volume by a small amount, and because the ratio is sensitive to clearance, a small clearance change moves the ratio noticeably: the table on this page shows that moving clearance from 50 cc to 60 cc, a 10 cc change, moves the ratio from 11.0:1 to 9.3:1, a change of nearly two full ratio points. A gasket that adds a few cubic centimetres to the clearance volume, or a deck height that subtracts a few, therefore moves the built ratio away from the nominal ratio by a visible amount, even though the nominal calculation was exact. Enter the clearance volume that includes every detail you know about, gasket, deck, and chamber shape, and treat a ratio from nominal volumes as a planning figure, which is what the page calls it, not as a measurement of the finished engine.

The same discipline applies to swept volume, though it matters less, because swept volume appears only on top of the fraction. A swept volume measured with the wrong bore or stroke gives a wrong total volume and therefore a wrong ratio, but the error scales with the swept error, not amplified by it, unlike a clearance error, which is amplified by appearing in both parts of the fraction. Measure bore and stroke from the engine’s specification, compute swept volume from those figures, and add the full clearance volume, including gasket and deck effects, before dividing. If the specification gives a ratio directly, compare it with the calculator’s ratio from your volumes: agreement confirms your volumes, while disagreement names the volume to re-measure, and the clearance volume is the first suspect, because it moves the ratio most and is the easiest to have measured incompletely.

On the file side, the omitted dimension is quality, and it cuts the other way: a file ratio can be high precisely because data was discarded. Lossless compression preserves every byte of the original data and can be reversed exactly, so its ratio measures redundancy removed, nothing else. Lossy compression discards data the format judges less important, so its ratio measures redundancy removed plus data discarded, and the same ratio from the two methods describes different results: one file that is identical to the original when decompressed, and one that is smaller but changed. The page’s disclaimer states the boundary: file ratios describe size only and say nothing about quality loss in lossy formats. A ratio of 4.0:1 on a losslessly compressed archive and a ratio of 4.0:1 on a lossy photograph are not the same achievement, and comparing them as if they were rewards the method that threw data away. Judge a file ratio together with the method and the quality of the result, never alone, and keep the original whenever the compressed file’s quality has not been checked, because a ratio cannot tell you what was lost.

There is one more file-side omission worth stating, because it misleads in the opposite direction: a low ratio does not mean compression failed to try. Already compressed data, such as JPEG photographs, MP4 video, and ZIP archives, have little redundancy left, so even a good compressor finds little to remove, and the archive headers can add more bytes than compression saves, producing a ratio below 1 and a negative space saved. That result is not a failure of the compressor or of the calculator; it is the correct measurement of an incompressible input, and the correct response is to keep the original, as the guide above says. Chasing a higher ratio on such a file by trying more aggressive settings usually adds overhead or discards quality, and neither improves the file. The ratio measures the file, not the effort, and an incompressible file’s ratio is information about the file, not a verdict on the tool.

Static ratio versus dynamic compression: the number on the spec sheet

The ratio this calculator computes from swept and clearance volume is the static compression ratio: a geometric fact about the cylinder, fixed by the parts. The pressure the charge actually reaches is a different quantity, called dynamic or effective compression, and it depends on when the intake valve closes. An engine with late intake-valve closing pushes part of the charge back out before compression begins, so the trapped volume is smaller than the swept volume and the effective ratio is lower than the static ratio, sometimes by a full point or more.

That gap is why two engines with the same static ratio can demand different fuels and behave differently. Variable valve timing moves the closing point with speed and load, so the effective ratio changes across the rev range while the static ratio never moves, and a turbocharger raises the pressure of the charge before compression starts, which raises the effective compression without changing the static ratio at all. Read the spec-sheet ratio as the starting point of the story, and the fuel requirement, the knock behaviour and the measured cylinder pressures as the rest of it. The companion guide on octane works through how fuel choice follows from the effective ratio rather than the static one.

Reading a compression test: what the gauge is actually telling you

A compression test measures cranking pressure in pounds per square inch, cylinder by cylinder, with the throttle open and the engine warm. Healthy petrol engines commonly read in a broad band, often roughly 120 to 180 psi depending on the engine, and the absolute number matters less than the spread: a common rule of thumb is that no cylinder should read more than about 10 to 15 percent below the highest cylinder. A single low cylinder points to a problem in that cylinder, a valve, a ring or a gasket, while all cylinders reading low together points to something shared, such as general wear or a timing problem.

A compression test does not measure the compression ratio. The ratio is a volume calculation, and the gauge reads a pressure that also depends on cranking speed, temperature, valve sealing and how much charge the cylinder traps, so converting a psi reading back into a ratio is not reliable. Use the test for what it is good at: comparing cylinders with each other and with the manufacturer’s specification for that engine. A reading far below specification on every cylinder, or a large spread between cylinders, is a reason for a leak-down test and a mechanic’s diagnosis, not for a ratio calculation.

Frequently asked questions

What is a good engine compression ratio?

Most road car petrol engines run between 9:1 and 12:1, while many diesel engines run much higher, often 15:1 to 20:1. The right ratio depends on fuel, engine design, and forced induction, so this calculator reports the ratio only and does not recommend one.

How do I work out engine compression ratio from swept and clearance volume?

Add swept volume and clearance volume, then divide by clearance volume. For 500 cc swept and 50 cc clearance, that is 550 divided by 50, which is 11.0:1.

How do I work out a file compression ratio?

Divide original size by compressed size. A 100 MB file compressed to 25 MB gives 100 divided by 25, which is 4.0:1, and space saved is 75 percent.

What is the difference between compression ratio and space saved?

Ratio compares the two sizes directly, while space saved states the reduction as a percent of the original. A 4.0:1 ratio and 75 percent saved describe the same 100 MB to 25 MB result in two ways.

Can I mix megabytes and gigabytes in the file tab?

No. Both sizes must use the same unit, or the ratio will be wrong by a factor of about 1,000. Convert one size first, then enter both in megabytes or both in gigabytes.

Why does my compressed file sometimes get bigger?

Already compressed formats such as JPEG photos, MP4 video, and ZIP archives have little redundancy left to remove, and the archive headers can add more bytes than compression saves. A ratio below 1:1 and negative space saved show this clearly.

What ratio does a 40 cc clearance volume give?

With a 500 cc swept volume, a 40 cc clearance volume gives a ratio of 13.5:1. The total cylinder volume is 540.00 cc, the clearance share of the total is 7.41 percent, and the swept share is 92.59 percent. Compare the default 50 cc clearance, which gives 11.0:1, and the 80 cc clearance, which gives 7.3:1: a smaller clearance raises the ratio fast, because clearance appears in both the top and the bottom of the fraction.

What happens if the compressed file is bigger than the original?

The ratio drops below 1 and the space saved goes negative, which means compression added overhead instead of saving space. A 100 MB file compressed to 150 MB gives a ratio of 0.7:1, a space saved of minus 50.00 MB, a saved percent of minus 50.00 percent, and a compressed share of 150.00 percent. That happens with already compressed data such as photos and videos, and the correct response is to keep the original rather than compressing again.

Does scaling both file sizes change the ratio?

No. A 1000 MB original compressed to 250 MB gives the same ratio of 4.0:1, the same 75.00 percent saved, and the same 25.00 percent compressed share as a 100 MB original compressed to 25 MB. Only the space saved scales, from 75.00 MB to 750.00 MB. The ratio describes the proportion, not the size, as long as both sizes use the same unit.

What does a 1.0:1 file ratio mean?

It means compression did nothing. A 100 MB file compressed to 100 MB gives a ratio of 1.0:1, a space saved of 0.00 MB, a saved percent of 0.00 percent, and a compressed share of 100.00 percent. The compressed file is exactly the original size, so no space was saved and none was lost.

Can I use regular fuel in a high-compression engine?

Only if the manufacturer says so. A high static ratio raises the effective compression and the knock risk, and most high-compression engines are specified for premium fuel for that reason. Some modern engines with direct injection and knock sensors can run regular fuel by retarding the timing, at some cost in power and efficiency. The owner’s manual is the authority: it names the minimum octane, and running below it risks knock damage that the knock sensor cannot always prevent.

How do turbochargers and superchargers change the effective compression?

They raise the pressure of the intake charge before compression begins, so the cylinder starts compression from a higher pressure and reaches a higher peak pressure, even though the static ratio is unchanged. That is why forced-induction engines often run a lower static ratio than naturally aspirated engines on the same fuel: the boost supplies part of the compression, and the static ratio must leave room for it without causing knock.

Why is a diesel compression ratio so much higher than a petrol ratio?

A diesel has no spark plug, so it must compress the air until it is hot enough to ignite the injected fuel on its own. That needs ratios far above petrol practice, commonly 16:1 to 22:1, where the air reaches several hundred degrees. The high ratio is a requirement of the ignition method, not a performance choice, and it is also why diesel engines are built heavier: the peak pressures are far higher.

What does a compression test reading actually mean?

It measures cranking pressure per cylinder, commonly roughly 120 to 180 psi on a healthy petrol engine, and the spread between cylinders matters more than any single number. A common rule of thumb is that no cylinder should read more than about 10 to 15 percent below the highest. A test reading is a pressure, not a ratio: it cannot be converted back into a compression ratio, because cranking speed, temperature and valve sealing all affect it.

Disclaimer: This calculator reports ratios from the numbers you enter. Engine ratios are planning figures only and do not account for real combustion chamber shape, gasket thickness, or piston deck height unless those are already included in your clearance volume. File ratios describe size only and say nothing about quality loss in lossy formats.

↑