Early access is open. Free sample datasets are live now. Download a sample

Learn

NBBO Explained: The National Best Bid and Offer

7 min read · Updated 19 November 2026 · By the marketdata.co data team

A US stock trades on more than a dozen exchanges at once, each with its own best bid and best offer. The NBBO is the single best bid and best offer across all of them, and it is the reference price for best execution, for trade classification, and for any spread you calculate. If your quote data isn't the NBBO, your spread numbers are probably too wide.

How it works

How the NBBO is built

Every exchange sends its top-of-book quote to a Securities Information Processor (SIP). There are two: the CTA for NYSE-listed and other non-Nasdaq stocks, and the UTP plan for Nasdaq-listed stocks. The SIP picks the highest bid and the lowest offer across all venues and publishes that pair as the NBBO, along with which exchange holds each side.

Under Regulation NMS, brokers generally can't execute a trade at a price worse than the protected NBBO. That is why the NBBO matters for execution analysis: it is the benchmark every fill is measured against.

Worked example (illustrative numbers)

At one moment three exchanges quote a stock:

exchange bid bid_size ask ask_size
A 100.02 300 100.05 200
B 100.03 100 100.06 500
C 100.01 800 100.04 100

The NBBO is 100.03 × 100.04: B has the best bid, C has the best ask. So the spread is one cent. Looking at exchange A alone you'd see three cents, three times wider than the real market.

Now a trade prints at 100.04 for 100 shares. It's at the ask, so it was most likely a buyer lifting the offer. A print at 100.035 would be a midpoint execution, typical of dark pools. Comparing each trade with the NBBO at that instant is how flow is classified as buyer- or seller-initiated.

Code

Use NBBO quotes in Python

Our STK-QUOTES schema has one row per NBBO update: symbol, timestamp, bid_price, bid_size, bid_exchange, ask_price, ask_size, ask_exchange, plus conditions and sequence_number. The code below measures the time-weighted spread and tags trades by side.

"""Example: time-weighted NBBO spread and trade-side classification."""
import pandas as pd

q = pd.read_csv("nbbo_quotes.csv", parse_dates=["timestamp"]).sort_values("timestamp")
t = pd.read_csv("trades.csv", parse_dates=["timestamp"]).sort_values("timestamp")

q["spread"] = q["ask_price"] - q["bid_price"]
q["mid"] = (q["ask_price"] + q["bid_price"]) / 2
q["spread_bps"] = q["spread"] / q["mid"] * 10_000

q["held_for"] = q["timestamp"].shift(-1) - q["timestamp"]
w = q["held_for"].dt.total_seconds()
print("time-weighted spread (bps):", round((q["spread_bps"] * w).sum() / w.sum(), 2))

m = pd.merge_asof(t, q[["timestamp", "bid_price", "ask_price", "mid"]],
                  on="timestamp", direction="backward")
m["side"] = "mid"
m.loc[m["price"] >= m["ask_price"], "side"] = "buy"
m.loc[m["price"] <= m["bid_price"], "side"] = "sell"
print(m["side"].value_counts(normalize=True).round(3))

The first number is the spread you would actually have faced on average through the day, in basis points. merge_asof with direction="backward" matches each trade to the last quote before it, which avoids looking ahead. The side split tells you how much volume hit the ask, hit the bid, or traded in between.

Watch out

Common mistakes

Using a single exchange's quotes as the market. Direct feeds from one venue miss better prices elsewhere. Spreads look wider and trade classification gets noisier.

Joining trades to quotes that arrived later. Using the next quote instead of the last one leaks future information into your classification. Use a backward as-of join.

Ignoring locked and crossed markets. Now and then the best bid equals or exceeds the best ask for a moment. Filter these rows before computing spreads, or your averages will include zero and negative spreads.

Mixing the two clocks. timestamp is when the SIP published; participant_timestamp is when the exchange stamped it. They differ by microseconds to milliseconds, which matters for latency studies.

Details

Get the data

NBBO quote history, tick by tick. What you'll get: every NBBO update with sizes, the exchange on each side, conditions and both timestamps.

  • NBBO quote data, available in early access. One year of history is planned for Pro ($79/mo). Suggested dataset price: $25 per symbol-year.
  • A free NBBO sample file is available on request.

FAQ

Frequently asked questions

What is NBBO?

NBBO stands for National Best Bid and Offer. It is the highest bid and lowest offer for a US stock across all exchanges, published by the SIPs. Brokers use it as the benchmark for best execution.

Who calculates the NBBO?

The Securities Information Processors do: the CTA for NYSE-listed and other non-Nasdaq securities, and the UTP plan for Nasdaq-listed securities. Some brokers and vendors also compute their own NBBO from direct exchange feeds, which can be slightly faster.

Is the NBBO the price I will get?

Not always. The NBBO covers only the displayed size at the top of book. A larger order can go through it to worse prices, and some orders fill inside it at better prices through midpoint or price improvement.

What is the difference between quotes and NBBO?

Quote data can mean any exchange's top of book. NBBO is the consolidated best across all of them at each moment. For spreads and trade classification, NBBO is the one you want.

Keep reading