BIP 141 defines vsize = ceil(weight / 4). This is weighted size, not always one physical byte; some Bitcoin Core policies additionally account for signature-operation costs.
Let B be size without witness and T total serialized size. Weight W = 3 × B + T is measured in WU, while virtual size is measured in vB. [BIP 141 — Segregated Witness] [Bitcoin Developer Reference — Transactions]
A base byte contributes 4 WU; data added by witness serialization, including marker and flag, contributes 1 WU per byte. This discount does not mean skipping its validation. [BIP 141 — Segregated Witness] [BIP 144 — SegWit peer services]
Round up the total for the whole transaction: 401 WU gives 101 vB. Adding individually rounded input estimates need not give the same result. [BIP 141 — Segregated Witness] [Bitcoin Core — decoderawtransaction RPC]
Without witness, B = T, so W = 4 × T and basic vsize equals the byte count. SegWit does not divide every transmitted byte by four. [BIP 141 — Segregated Witness]
Illustrative values B = 100 and T = 208 give W = 508 WU and vsize = 127 vB. The full serialization still requires transmitting all 208 bytes. [BIP 141 — Segregated Witness] [Bitcoin Core — decoderawtransaction RPC]
The fee is input value minus output value. At 127 vB and 2 sat/vB it is 254 sat; it is not directly a percentage of the amount transferred. [Bitcoin Core — policy fees] [Bitcoin Developer Reference — Transactions]
Before completion, a wallet estimates signatures, inputs and any change output. The effective rate follows only from the actual fee and final size. [Bitcoin Core — policy fees] [Bitcoin Core — decoderawtransaction RPC]
Bitcoin Core v29.0 also uses an adjusted size ceil(max(W, sigop_cost × bytes_per_sigop) / 4). Many signature operations can increase it; this changes neither BIP 141's basic formula nor consensus weight. [Bitcoin Core — transaction policy]
Package evaluation may compare total fees with the sum of relevant virtual sizes. This is not a simple average of individual transaction rates and guarantees neither acceptance nor confirmation. [Bitcoin Core — policy fees] [Bitcoin Core — transaction policy]
CompactSize is a variable-length integer encoding in serialization. Vbyte is a measurement unit; similar names do not imply the same format or a shortened file. [BIP 144 — SegWit peer services] [Bitcoin Developer Reference — Transactions]
For the clearest picture, read this entry together with Block weight, Compact block relay, Block propagation, Initial block download. The reverse links also lead from Block weight.