Bitcoin Transaction Weight Calculator: Estimate vBytes and Fees
Calculate bitcoin transaction weight in virtual bytes based on input and output types to estimate accurate fees for P2PKH, P2WPKH, P2WSH, and P2TR.
How Bitcoin Transaction Weight Works
Bitcoin transaction weight determines how much block space a transaction consumes and, therefore, how much you pay in fees. Since the SegWit activation in August 2017 (block 481,824), Bitcoin uses a weight-based system defined in BIP 141 instead of the old raw byte count. Non-witness bytes cost 4 weight units (WU) each, while witness bytes cost only 1 WU each. This 4:1 ratio is known as the witness discount.
To convert weight to the fee-relevant metric, divide by four: vBytes = weight / 4. Fee rates are quoted in sat/vB, so a transaction weighing 560 WU (140 vB) at 10 sat/vB costs 1,400 sats. The block limit is 4,000,000 WU (1,000,000 vB), replacing the old 1 MB cap.
Input Sizes by Address Type
Inputs dominate transaction weight because they include signatures and public keys. The following table shows single-signature input sizes for each address type. These figures include the outpoint (36 bytes), sequence (4 bytes), and the relevant scriptSig or witness data.
| Input Type | Non-Witness (bytes) | Witness (bytes) | Weight (WU) | vBytes |
|---|---|---|---|---|
| P2PKH (legacy) | 148 | 0 | 592 | 148 |
| P2SH-P2WPKH (nested SegWit) | 64 | 108 | 364 | 91 |
| P2WPKH (native SegWit) | 41 | 108 | 272 | 68 |
| P2TR (Taproot key-path) | 41 | 66 | 230 | 57.5 |
P2PKH inputs receive no witness discount because all data sits in the scriptSig. P2WPKH moves the signature and public key into the witness, cutting effective size by 54% compared to P2PKH. P2TR goes further: Schnorr signatures are 64 bytes (versus ~72 for DER-encoded ECDSA), and the public key is implicit in the output, eliminating the 33-byte pubkey push entirely.
Multisig Input Sizes
Multisig inputs are substantially larger because they include multiple signatures and a redeem or witness script. The following table compares 2-of-3 multisig input sizes across wrapping styles.
| Input Type (2-of-3) | Non-Witness (bytes) | Witness (bytes) | Weight (WU) | vBytes |
|---|---|---|---|---|
| P2SH (bare legacy) | 296 | 0 | 1,184 | 296 |
| P2SH-P2WSH (nested) | 76 | 252 | 556 | 139 |
| P2WSH (native SegWit) | 41 | 252 | 416 | 104 |
| P2TR (MuSig2 key-path) | 41 | 66 | 230 | 57.5 |
A P2WSH 2-of-3 input saves 65% over bare P2SH thanks to the witness discount. With MuSig2 key aggregation on Taproot, a 2-of-3 spend looks identical to a single-sig key-path spend at 57.5 vB, an 81% reduction from legacy P2SH. For a deeper comparison, see the Taproot fee savings calculator.
Output Sizes by Address Type
Outputs are simpler: they contain an 8-byte value field, a 1-byte script length prefix, and the scriptPubKey. Since outputs are entirely non-witness data, their vByte and byte sizes are identical.
| Output Type | scriptPubKey (bytes) | Total (vBytes) |
|---|---|---|
| P2PKH | 25 | 34 |
| P2SH | 23 | 32 |
| P2WPKH | 22 | 31 |
| P2WSH | 34 | 43 |
| P2TR | 34 | 43 |
P2TR and P2WSH outputs are 12 bytes larger than P2WPKH because they use 32-byte hashes instead of 20-byte hashes. This means sending to a Taproot address costs slightly more in output weight, but the savings on the input side more than compensate when the recipient later spends.
Transaction Overhead
Every transaction includes a fixed overhead of approximately 10.5 vB for SegWit transactions, broken down as follows:
- Version: 4 bytes (non-witness) = 4 vB
- SegWit marker and flag: 2 bytes (witness) = 0.5 vB
- Input count: 1 byte (non-witness) = 1 vB
- Output count: 1 byte (non-witness) = 1 vB
- Locktime: 4 bytes (non-witness) = 4 vB
For legacy (non-SegWit) transactions, the marker and flag are absent, bringing overhead to 10 vB. The input and output count fields use CompactSize encoding, so transactions with 253+ inputs or outputs add an extra 2 bytes per count field.
Calculating Total Transaction Weight
The formula is straightforward: total vBytes = overhead + (sum of input vBytes) + (sum of output vBytes). The following table shows complete transaction weights for common patterns, all using native SegWit (P2WPKH) inputs and outputs.
| Pattern | Inputs | Outputs | vBytes | Use Case |
|---|---|---|---|---|
| Simple send | 1 P2WPKH | 2 P2WPKH | ~141 | Standard payment with change |
| No-change send | 1 P2WPKH | 1 P2WPKH | ~110 | Exact amount, no change needed |
| Batch payout (5 recipients) | 1 P2WPKH | 6 P2WPKH | ~265 | Exchange withdrawal batching |
| UTXO consolidation (10 inputs) | 10 P2WPKH | 1 P2WPKH | ~722 | Merging small UTXOs during low fees |
| 2-of-3 multisig send | 1 P2WSH | 2 P2WPKH | ~177 | Multisig treasury withdrawal |
| Taproot simple send | 1 P2TR | 2 P2TR | ~154 | Modern Taproot wallet payment |
For a comprehensive reference of byte-level breakdowns, see the Bitcoin transaction size reference.
From Weight to Fee Estimation
Once you know a transaction's weight in vBytes, multiply by the current fee rate to get the total fee: fee (sats) = vBytes × fee rate (sat/vB). The following table illustrates costs for a standard P2WPKH simple send (~141 vB) at various fee rates.
| Fee Rate (sat/vB) | Fee (sats) | Fee (USD at $100k/BTC) | Typical Conditions |
|---|---|---|---|
| 1 | 141 | $0.14 | Weekend / empty mempool |
| 5 | 705 | $0.71 | Low congestion |
| 20 | 2,820 | $2.82 | Normal weekday traffic |
| 50 | 7,050 | $7.05 | Moderate congestion |
| 150 | 21,150 | $21.15 | High congestion / fee spike |
| 500 | 70,500 | $70.50 | Extreme congestion event |
For real-time fee rate data, use the fee estimator. During fee spikes, the difference between address types becomes significant: the same simple send costs 148 vB with P2PKH but only 141 vB with P2WPKH and ~154 vB with P2TR (which pays slightly more in outputs but saves on future spends). At 150 sat/vB, that P2PKH-to-P2WPKH gap alone saves over $1.
Why the Witness Discount Exists
The 4:1 weight ratio is not arbitrary. Witness data (signatures and public keys) is only needed during transaction validation, not for tracking the UTXO set. Full nodes can prune witness data after verification, while UTXO data must persist indefinitely. Discounting witness bytes incentivizes transaction formats that minimize the long-term storage burden on nodes.
This design also fixed transaction malleability by moving signatures outside the transaction hash, which was a prerequisite for the Lightning Network and other off-chain protocols. For more on how SegWit and Taproot reduce transaction costs, see our research on Bitcoin address types from P2PKH to Taproot.
The 4M Weight Unit Block Limit
Each Bitcoin block can hold up to 4,000,000 weight units. In practice, blocks typically weigh between 1.5 and 2.5 million WU (roughly 1.5 to 2.5 MB on disk) because real transaction mixes contain both witness and non-witness data. A block filled entirely with witness data could approach 4 MB, while a block of pure legacy transactions would cap at approximately 1 MB.
This means the block space available for your transaction depends on the mix of transaction types in the mempool. When block weight is consistently near the limit, fee rates rise as transactions compete for inclusion. Understanding your transaction's weight helps you set an appropriate fee rate and avoid overpaying during low-congestion periods.
Optimization Strategies
Knowing how weight is calculated unlocks several fee-saving strategies:
- Use native SegWit (P2WPKH) or Taproot (P2TR) addresses to maximize the witness discount on inputs
- Batch multiple payments into a single transaction to amortize the ~10.5 vB overhead and reduce per-payment cost by up to 75%
- Consolidate small UTXOs during low-fee periods to avoid paying high fees on multi-input transactions later
- Use MuSig2 or FROST for multisig to compress multiple signatures into a single Schnorr key-path spend at 57.5 vB per input
- Avoid creating unnecessary change outputs by using precise coin selection
For users who want to avoid on-chain fees entirely, layer 2 solutions like Spark enable instant Bitcoin and stablecoin transfers off-chain, settling to Bitcoin's base layer only when needed. This is particularly useful for small or frequent payments where on-chain fees would be disproportionate to the transfer amount.
Frequently Asked Questions
What is the difference between transaction weight and virtual bytes?
Transaction weight is measured in weight units (WU), where non-witness bytes count as 4 WU and witness bytes count as 1 WU. Virtual bytes (vBytes) equal weight divided by 4. Fee rates are quoted in sat/vB, so vBytes is the metric you use when calculating fees. A 560 WU transaction is 140 vB.
How much does a standard Bitcoin transaction weigh?
A typical single-input, two-output P2WPKH transaction weighs about 141 vB (564 WU). Legacy P2PKH transactions of the same shape weigh about 226 vB (904 WU). Taproot (P2TR) transactions weigh about 154 vB (616 WU), though future spends of Taproot outputs save significantly compared to other types.
Why are SegWit transactions cheaper than legacy transactions?
SegWit moves signatures and public keys into the witness section, which is counted at one quarter of the rate of non-witness data. A P2WPKH input weighs 68 vB versus 148 vB for P2PKH, a 54% reduction. This witness discount was introduced because witness data only needs to exist during validation, not in the permanent UTXO set that nodes store.
How does Taproot reduce transaction weight compared to SegWit?
Taproot (P2TR) uses 64-byte Schnorr signatures instead of ~72-byte DER-encoded ECDSA signatures, and the public key is embedded in the output rather than pushed in the witness. This brings a single-sig input down to 57.5 vB from 68 vB (P2WPKH). The savings are even more dramatic for multisig: a MuSig2 key-path spend looks like a single-sig spend at 57.5 vB, versus 104 vB for a 2-of-3 P2WSH input.
What is the maximum Bitcoin block size in weight units?
The maximum block weight is 4,000,000 WU (1,000,000 vB). This replaced the old 1 MB block size limit when SegWit activated in August 2017. Real blocks typically weigh 1.5 to 2.5 million WU because transactions contain a mix of witness and non-witness data. A block composed entirely of witness data could approach 4 MB on disk, but this is not seen in practice.
How do I estimate fees for a multisig transaction?
Multisig inputs are significantly heavier than single-sig. A 2-of-3 P2WSH input weighs 104 vB, versus 68 vB for a single-sig P2WPKH input. Use the formula: fee = (10.5 + input_vbytes + output_vbytes) × fee_rate. For a 2-of-3 P2WSH transaction with one input and two P2WPKH outputs, that is roughly (10.5 + 104 + 62) × fee_rate = 177 vB × fee_rate. Upgrading to MuSig2 on Taproot reduces the input to 57.5 vB.
Does the number of outputs affect transaction weight significantly?
Each output adds 31 to 43 vB depending on the address type. For payment batching, this is relatively cheap: five additional P2WPKH outputs add only 155 vB to the transaction. The fixed overhead and input weight are amortized across all recipients, which is why transaction batching can save up to 75% on per-payment fees compared to sending individual transactions.
This tool is for informational purposes only and does not constitute financial advice. Transaction weight estimates are based on typical single-signature and 2-of-3 multisig configurations. Actual weights may vary depending on signature sizes, script complexity, and wallet implementation. Always verify with your wallet's fee estimation before broadcasting.
Build with Spark
Integrate bitcoin, Lightning, and stablecoins into your app with a few lines of code.
Read the docs →
