# Slippage calculator for trading: walk the order book

URL: https://fincodelabs.com/en/tools/slippage-calculator · Publisher: Fincode (Fincode Yazılım ve Teknoloji A.Ş.), Istanbul, Turkey · Updated: 2026-10-15

A trading slippage calculator: type the order book levels and your order size to see the average fill, the levels consumed and the slippage in basis points and money, or compare expected and actual prices from a fill log. Free, no sign-up required.

## Calculator

The calculation runs in the browser in the form on this page: https://fincodelabs.com/en/tools/slippage-calculator

**Inputs**
- Mode: Order book: walk the levels you type. Fill log: compare expected and actual prices
- Side: A buy walks the asks from the lowest; a sell walks the bids from the highest
- Quote currency: A label only; nothing is converted
- Order size: The quantity you want filled (default: 150)
- Mid price: Optional; for slippage from mid (default: 99.95)
- Level 1 price: Any order; the tool sorts them (default: 100)
- Level 1 size: Quantity at that price (default: 40)
- Level 2 price (default: 100.05)
- Level 2 size (default: 60)
- Level 3 price (default: 100.10)
- Level 3 size (default: 80)
- Level 4 price (default: 100.20)
- Level 4 size (default: 120)
- Level 5 price (default: 100.40)
- Level 5 size (default: 200)
- Level 6 price
- Level 6 size
- Level 7 price
- Level 7 size
- Level 8 price
- Level 8 size
- Level 9 price
- Level 9 size
- Level 10 price
- Level 10 size
- Fill 1 side: Buy or sell
- Fill 1 expected price: The price you expected (default: 100)
- Fill 1 actual price: The price you got (default: 100.04)
- Fill 2 side
- Fill 2 expected price (default: 100)
- Fill 2 actual price (default: 99.97)
- Fill 3 side
- Fill 3 expected price (default: 250)
- Fill 3 actual price (default: 250.30)
- Fill 4 side
- Fill 4 expected price (default: 50)
- Fill 4 actual price (default: 49.99)
- Fill 5 side
- Fill 5 expected price
- Fill 5 actual price
- Fill 6 side
- Fill 6 expected price
- Fill 6 actual price
- Fill 7 side
- Fill 7 expected price
- Fill 7 actual price
- Fill 8 side
- Fill 8 expected price
- Fill 8 actual price
- Fill 9 side
- Fill 9 expected price
- Fill 9 actual price
- Fill 10 side
- Fill 10 expected price
- Fill 10 actual price

**Results:** Slippage from the best price, Average fill price, Levels consumed, Quantity filled, Unfilled remainder, Cost against the best price, Slippage from mid, Cost against mid, Fills counted, Buys: average slippage, Buys: worst slippage, Sells: average slippage, Sells: worst slippage

> All numbers are typed by you and the defaults are hypothetical: no live data, no asset, no platform. A real fill can differ, because a book changes while an order travels. The result says nothing about what slippage is acceptable and does not forecast any cost.

## How slippage is calculated

In trading, slippage is the gap between a reference price and the price you actually get, in basis points or money. An order larger than the best level walks up the book, so its average fill is worse than the best price. The calculator uses:

**Average fill = sum of (level price × quantity taken) ÷ quantity filled**

**Buy: slippage = (average fill − reference) ÷ reference × 10,000 basis points**

**Sell: slippage = (reference − average fill) ÷ reference × 10,000 basis points**

**Cost = the same price difference × quantity filled**

Positive slippage is worse than the reference and negative is better. FINRA's order types page says a market order may not get the price you saw or were quoted, especially in fast-moving markets, and a typed book is a snapshot of that moment. A buy consumes asks from the lowest and a sell consumes bids from the highest; the tool sorts the levels itself. If the levels do not cover your order, it reports the unfilled remainder and measures the filled part.

## Worked example: walking the book

> **Hypothetical example:** a buy of 150 against these calculator defaults, with a mid price of 99.95. The levels are made up and describe no market.
>
> | Ask price | Size | Taken | Amount |
> | ---: | ---: | ---: | ---: |
> | 100.00 | 40 | 40 | 4,000.00 |
> | 100.05 | 60 | 60 | 6,003.00 |
> | 100.10 | 80 | 50 | 5,005.00 |
> | 100.20 | 120 | 0 | 0 |
> | 100.40 | 200 | 0 | 0 |
>
> Average fill: 15,008 ÷ 150 = **100.053333 USD**, using 3 of 5 levels. From the best price of 100.00: (100.053333 − 100) ÷ 100 × 10,000 = **5.33 bps**, or 15,008 − 15,000 = 8.00 USD. From the mid: **10.34 bps**, or 15.50 USD.

**The same hypothetical book at other sizes. This shows how size changes the arithmetic and is no estimate for a real order.**

| Order size | Average fill | Levels | From best | From mid |
| ---: | ---: | ---: | ---: | ---: |
| 40 | 100.00 | 1 | 0.00 bps | 5.00 bps |
| 150 | 100.053333 | 3 | 5.33 bps | 10.34 bps |
| 300 | 100.116667 | 4 | 11.67 bps | 16.68 bps |
| 500 | 100.23 | 5 | 23.00 bps | 28.01 bps |

## Best price or mid: which reference?

The two references answer different questions. Slippage from the best price measures only the cost of going through the depth. Slippage from the mid also counts half the spread, so it stays above zero even for an order that fits in the best level, as the first row of the table shows. Use one reference consistently when you compare fills.

## Fill log mode: measure a running bot

Fill log mode compares the price you expected with the price you got, per side, for fills that already happened. The expected price is whatever your software recorded when it decided to trade.

**Hypothetical fills, the defaults of this mode.**

| Side | Expected | Actual | Slippage |
| --- | ---: | ---: | ---: |
| Buy | 100 | 100.04 | 4.00 bps |
| Sell | 100 | 99.97 | 3.00 bps |
| Buy | 250 | 250.30 | 12.00 bps |
| Sell | 50 | 49.99 | 2.00 bps |

Buys average 8.00 bps with a worst of 12.00 bps, sells average 2.50 bps with a worst of 3.00 bps, and all four average 5.25 bps. The averages are simple, per fill, so a small fill counts as much as a large one.

## Slippage in backtests

Backtests often model slippage as a flat figure, while a book walk depends on size. TradingView's strategy properties page, for example, describes slippage as a value in ticks added to the fill price of market or stop orders, so the figure does not grow with order size. Comparing fill logs with a backtest's assumption is one way to see whether it was too kind. The [backtesting pitfalls guide](https://fincodelabs.com/en/blog/backtesting-trading-strategy-pitfalls) covers unrealistic fills, and [slippage in crypto](https://fincodelabs.com/en/blog/slippage-crypto) explains the idea in more depth. Recording those fills is part of [custom crypto trading bot development](https://fincodelabs.com/en/services/algorithmic-trading).

## Which values to enter

- **Side and order size:** the quantity you want filled, in units of the asset.
- **Levels:** up to ten prices and sizes from your own copy of the book, in any order. Keeping such a copy is covered in [local order book via WebSocket](https://fincodelabs.com/en/blog/websocket-order-book).
- **Mid price:** optional; the point halfway between the best bid and the best ask.
- **Fees:** not included. The [crypto trading fee calculator](https://fincodelabs.com/en/tools/crypto-trading-fee-calculator) adds fees to a fixed slippage figure, while this page works out that figure.

## Frequently asked questions

### How do you calculate slippage?

Compare the average fill with a reference price. For a buy, slippage is the average fill minus the reference, divided by the reference; for a sell, the reference minus the average fill, divided by the reference. Multiply by 10,000 for basis points.

### What is a basis point of slippage?

One basis point is 0.01% of the reference price. At a reference of 100, an average fill of 100.0533 on a buy is 5.33 basis points.

### Is slippage always a cost?

No. A fill better than the reference gives negative slippage, as the tool shows with a minus sign. On a market order walking a book, measured from the best price, it can only be zero or a cost.

### What is the difference between slippage and spread?

The spread is the gap between the best bid and the best ask before you trade. Slippage is how far your fill lands from a reference price. Measured from the mid, slippage includes half the spread.

### Can I use this slippage calculator for forex?

Yes, for any market where you can type price levels and sizes, because the formula does not depend on the asset. It gives basis points and not pips, and the page holds no market data.

### What is an acceptable slippage level?

This page does not set one. Slippage depends on the market, the size and the moment, and the calculator only measures what you type.

## Sources

- [FINRA: Order types (market, limit and stop orders)](https://www.finra.org/investors/investing/investment-products/stocks/order-types)
- [FINRA: Understanding order types can save time and money](https://syndication.finra.org/content/understanding-order-types-can-save-time-and-money)
- [TradingView: Strategy properties, slippage (read 5 November 2026)](https://www.tradingview.com/support/solutions/43000628599-strategy-properties/)

> This calculator is general information, not tax, legal or investment advice. Results depend on the values you enter; fees, margin rules and tax rules differ by exchange and country and change over time, so check the official source and ask a licensed adviser about your own situation. Sources, checks and corrections: see the [editorial policy](https://fincodelabs.com/en/editorial-policy).

---

Published by Fincode (Fincode Yazılım ve Teknoloji A.Ş.), a software company in Istanbul, Turkey: https://fincodelabs.com/en/tools/slippage-calculator

Cite as: Fincode, "Slippage calculator for trading: walk the order book", updated October 15, 2026, https://fincodelabs.com/en/tools/slippage-calculator
