For size B without witness and full size T, W = 3 × B + T. The calculation covers the entire serialized block, including its header and coinbase.
B is the original serialization size without witness data; T is full serialization size. W = 3 × B + T combines both values and produces WU, not bytes. [BIP 141 — Segregated Witness] [BIP 144 — SegWit peer services]
A base byte costs 4 WU. A byte added by witness serialization costs 1 WU, including marker, flag and other serialization items in that portion. [BIP 141 — Segregated Witness] [BIP 144 — SegWit peer services]
BIP 141 requires W ≤ 4,000,000 WU. Equality is allowed; higher fees, more Proof of Work or a miner's approval cannot excuse exceeding it. [BIP 141 — Segregated Witness] [Bitcoin Core v29.0 — consensus limits] [Bitcoin Core v29.0 — validation]
Illustrative B = 500,000 and T = 2,500,000 give W = 4,000,000 WU. B = 750,000 and T = 1,750,000 give the same weight; a full block therefore has no fixed size of 4 MB. [BIP 141 — Segregated Witness]
A block also contains an 80-byte header, an encoded transaction count and coinbase. Header and count are base data; adding only the weights of other transactions is insufficient. [Bitcoin Developer Reference — Block chain]
Transaction vsize rounds W / 4 upward for each whole transaction. Adding these rounded sizes also omits some block overhead and is not the exact consensus weight calculation. [BIP 141 — Segregated Witness] [Bitcoin Developer Reference — Block chain]
A Full Node still verifies the applicable signatures and scripts. Witness data consumes bandwidth and computation; its lower weight means neither zero cost nor optional verification. [BIP 141 — Segregated Witness] [Bitcoin Core v29.0 — validation]
Alongside weight, BIP 141 has a limit of 80,000 signature-operation cost units. This is not a simple count of all signatures; rules depend on script type and newer versions have additional limits of their own. [BIP 141 — Segregated Witness] [Bitcoin Core v29.0 — consensus limits]
A miner may choose a lower target weight for operational reasons. Neither its template nor a node's local policy changes the consensus maximum or guarantees inclusion of a particular transaction. [Bitcoin Core v29.0 — consensus limits] [Bitcoin Core v29.0 — validation]
Bitcoin Core v29.0 getblock returns size, strippedsize and weight. The chainwork field is different: it relates to accumulated chain work, not the byte-weight of its blocks. [Bitcoin Developer Reference — Block chain] [Bitcoin Core — getblock RPC]
For the clearest picture, read this entry together with Virtual byte (vbyte), Witness data, SegWit, Blocksize War. The reverse links also lead from Virtual byte (vbyte), Witness data.