What is a pip in forex A pip is the standard unit for measuring how far a currency pair's price moves. For most pairs it is the fourth decimal place, 0.0001. For pairs quoted in Japanese yen it is the second decimal place, 0.01. When EURUSD moves from 1.16934 to 1.17034 it has moved 10 pips, and when USDJPY moves from 155.20 to 155.30 that is also 10 pips, even though the raw difference is a hundred times larger. The convention exists so traders, risk systems, and P&L reports can describe moves in one consistent unit per pair.
The name is short for "percentage in point" (some sources prefer "price interest point"; both circulate). Etymology aside, code needs exactly two numbers: the pip size of the pair and the pip value of the position. Both are pure arithmetic, and the second one starts from a live quote. This post works through the math for EURUSD and USDTRY step by step, with quotes pulled from the SiftingIO API.
Pip size: four-decimal pairs, JPY pairs, and fractional pips#
Most currency pairs are quoted to four decimal places by convention, so one pip equals 0.0001 of the quote currency. That covers majors like EURUSD and GBPUSD as well as exotics like USDTRY and USDMXN. Pairs where the quote currency is Japanese yen are the exception: a yen price like 155.27 carries its economic precision in two decimals, so one pip is 0.01.
Modern price feeds add one more digit, the fractional pip (also called a pipette), worth a tenth of a pip. That is why a live EURUSD quote reads 1.16934 with five decimals and a USDJPY quote reads 155.203 with three. The extra digit exists so spreads can be expressed more precisely; it does not change the pip itself.
| Pair type | Examples | Quote precision | Pip size | Fractional pip |
|---|---|---|---|---|
| Four-decimal | EURUSD, GBPUSD, USDTRY | 5 decimals | 0.0001 | 0.00001 |
| JPY-quoted | USDJPY, EURJPY, GBPJPY | 3 decimals | 0.01 | 0.001 |
A useful mental check: in a five-decimal quote the pip is the second digit from the right, not the last one. That distinction causes a real bug, covered in the pitfalls below.
Pull a live quote first#
Pip value math is anchored to the current price, so start by pulling one. The live snapshot endpoint returns the best bid and ask for a pair:
curl -H "X-API-Key: $SIFTING_KEY" "https://api.sifting.io/v1/last/quote/forex/EURUSD"
curl -H "X-API-Key: $SIFTING_KEY" "https://api.sifting.io/v1/last/quote/forex/USDTRY"
The response uses single-letter fields: b and a are the best bid and ask, B and A their sizes, and t is the timestamp. The prices come back as JSON strings, so cast them to numbers before doing any math, then average the two sides for a mid price. Suppose the calls return the following values. Yours will differ by the time you run this; the arithmetic will not.
- EURUSD: bid 1.16930, ask 1.16938, mid 1.16934
- USDTRY: bid 43.4980, ask 43.5060, mid 43.5020
One thing worth reading in pip units immediately is the spread. The EURUSD spread here is 0.00008, or 0.8 pips. The USDTRY spread is 0.0080, a full 80 pips. Exotic pairs trade with much wider spreads than majors, and pips are the unit that makes that comparison legible across pairs.
Pip value math, step by step#
Pip value answers a concrete question: how much money, in your account currency, does a one-pip move represent for a position of a given size Assume a USD account below.
EURUSD first.
- Fix the position size. A standard lot is 100,000 units of the base currency, so one EURUSD lot is 100,000 EUR.
- Compute one pip in the quote currency: pip size times position size, 0.0001 × 100,000 = 10 USD.
- Convert to the account currency. The quote currency is already USD, so the answer is $10.00 per pip per standard lot.
Notice the exchange rate never entered the calculation. For any pair quoted in USD, per-lot pip value in USD is fixed: $10 per standard lot, $1 per mini lot (10,000), $0.10 per micro lot (1,000). Sanity check: long 100,000 EURUSD at 1.16934, price ticks one pip to 1.16944, gain is 100,000 × 0.0001 = $10.
Now USDTRY.
- A standard lot is 100,000 USD, since USD is the base.
- One pip in the quote currency: 0.0001 × 100,000 = 10 TRY per pip.
- The account is in USD, so convert by dividing by the current USDTRY mid: 10 / 43.5020 = 0.22987, about $0.23 per pip per standard lot.
Two properties fall out of that division. The pip value floats with the rate, so it has to be recomputed from a live quote rather than hardcoded. And the wide spread now has a dollar figure: crossing 80 pips costs 80 × $0.23, about $18.39 per standard lot, versus 0.8 × $10 = $0.80 on EURUSD. Same formula in Python:
import requests
BASE = "https://api.sifting.io/v1"
HEADERS = {"X-API-Key": "sft_your_key_here"}
def pip_value_usd(pair: str, units: int = 100_000) -> float:
q = requests.get(f"{BASE}/last/quote/forex/{pair}", headers=HEADERS).json()
bid, ask = float(q["b"]), float(q["a"]) # prices come back as strings
mid = (bid + ask) / 2
pip = 0.01 if pair.endswith("JPY") else 0.0001
per_pip_quote_ccy = pip * units
if pair.endswith("USD"):
return per_pip_quote_ccy
if pair.startswith("USD"):
return per_pip_quote_ccy / mid
raise ValueError("cross pair: route the conversion through a USD pair")
print(pip_value_usd("EURUSD")) # 10.0
print(pip_value_usd("USDTRY")) # ~0.23 at a 43.50 mid
Cross pairs like EURJPY need one extra hop: the pip value lands in JPY, and converting it to USD means dividing by a live USDJPY quote. The snippet raises on that case rather than pretending to handle it.
Reference: pip size and per-lot pip value by pair type#
Computed at the example quotes above, with an illustrative 155.00 mid for USDJPY:
| Pair | Pip size | Per standard lot (100,000 base) | In USD |
|---|---|---|---|
| EURUSD | 0.0001 | 10 USD | $10.00, fixed for USD-quoted pairs |
| USDTRY | 0.0001 | 10 TRY | 10 / 43.5020 ≈ $0.23 |
| USDJPY | 0.01 | 1,000 JPY | 1,000 / 155.00 ≈ $6.45 |
Mini lots divide every figure by 10 and micro lots by 100. The pattern generalizes: pip value in the quote currency is always pip size times units, and only the conversion step depends on which currency your account settles in.
Common pitfalls#
Reading the fifth decimal as a pip. A move from 1.16934 to 1.16939 is 0.5 pips, not 5. Every modern feed quotes fractional pips, so code that counts "digits changed" overstates moves by a factor of ten. Compute pips explicitly as (new − old) / pip_size and the pipette takes care of itself.
Applying 0.0001 to JPY pairs. Using the four-decimal constant on USDJPY or GBPJPY understates every move and every pip value by a factor of 100. The wrong output still looks plausible at a glance, which is how it survives review. Branch on the quote currency, as the snippet above does.
Caching the conversion rate. For USDTRY the dollar pip value depends on the live rate, and an exotic pair can move enough intraday to skew P&L figures computed from yesterday's mid. Pull a fresh quote each time. If the API answers 503 with error code stale_snapshot, the snapshot is older than the freshness threshold; treat that as a signal to retry, never as license to fall back to an even older cached value.
Pip size is a table lookup and pip value is three lines of arithmetic anchored to a live quote. The forex snapshot endpoints used here work on the free tier with no credit card. Start building free.



