Skip to content
Small team, full backlog, zero orders dropped. Support replies are slower than we’d like. Read our status update → Zero orders dropped. Status → 📬 Check your spam folder — most of our replies land there. We do answer. Status update → 📬 Check your spam folder. Status →

Bitcoin Script Opcodes — Complete Reference

Every opcode in the Bitcoin Script language — the stack-based language that defines how bitcoins can be spent — with its hex byte, decimal value, category, status and function.

Quick answer

Bitcoin Script is a small, intentionally non-Turing-complete stack language: a locking script (scriptPubKey) sets spending conditions and an unlocking script (scriptSig / witness) satisfies them. This reference lists all 113 opcodes — word, hex byte, decimal, category, status and function. 15 are disabled (removed in 2010 for safety), several slots are reserved, and the upgradeable no-ops (OP_NOP1–NOP10) are how soft forks like CLTV and CSV added new rules without breaking old nodes.

Most everyday scripts use a handful of opcodes — OP_DUP, OP_HASH160, OP_EQUALVERIFY and OP_CHECKSIG build P2PKH; OP_CHECKMULTISIG, OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY enable multisig and time-locks; Tapscript adds OP_CHECKSIGADD.

Download CSV Download JSON REST API →

WordHexDecCategoryStatusBIPFunction
OP_0 / OP_FALSE0x000ConstantsEnabled—Push an empty byte array (numeric/boolean zero) onto the stack.
OP_PUSHBYTES_1–750x01–0x4b1ConstantsEnabled—The next opcode byte (1–75) is the number of subsequent bytes to push as data.
OP_PUSHDATA10x4c76ConstantsEnabled—The next 1 byte is the length; push that many following bytes.
OP_PUSHDATA20x4d77ConstantsEnabled—The next 2 bytes (LE) are the length; push that many following bytes.
OP_PUSHDATA40x4e78ConstantsEnabled—The next 4 bytes (LE) are the length; push that many following bytes.
OP_1NEGATE0x4f79ConstantsEnabled—Push the number -1 onto the stack.
OP_RESERVED0x5080ReservedReserved—Invalidates the script if executed (does nothing inside an unexecuted branch).
OP_1 / OP_TRUE0x5181ConstantsEnabled—Push the number 1 onto the stack.
OP_20x5282ConstantsEnabled—Push the number 2 onto the stack.
OP_30x5383ConstantsEnabled—Push the number 3 onto the stack.
OP_40x5484ConstantsEnabled—Push the number 4 onto the stack.
OP_50x5585ConstantsEnabled—Push the number 5 onto the stack.
OP_60x5686ConstantsEnabled—Push the number 6 onto the stack.
OP_70x5787ConstantsEnabled—Push the number 7 onto the stack.
OP_80x5888ConstantsEnabled—Push the number 8 onto the stack.
OP_90x5989ConstantsEnabled—Push the number 9 onto the stack.
OP_100x5a90ConstantsEnabled—Push the number 10 onto the stack.
OP_110x5b91ConstantsEnabled—Push the number 11 onto the stack.
OP_120x5c92ConstantsEnabled—Push the number 12 onto the stack.
OP_130x5d93ConstantsEnabled—Push the number 13 onto the stack.
OP_140x5e94ConstantsEnabled—Push the number 14 onto the stack.
OP_150x5f95ConstantsEnabled—Push the number 15 onto the stack.
OP_160x6096ConstantsEnabled—Push the number 16 onto the stack.
OP_NOP0x6197Flow controlEnabled—Does nothing.
OP_VER0x6298ReservedReserved—Invalidates the script if executed.
OP_IF0x6399Flow controlEnabled—Execute the following statements if the top stack value is true.
OP_NOTIF0x64100Flow controlEnabled—Execute the following statements if the top stack value is false.
OP_VERIF0x65101ReservedReserved—Invalidates the script even when inside an unexecuted branch.
OP_VERNOTIF0x66102ReservedReserved—Invalidates the script even when inside an unexecuted branch.
OP_ELSE0x67103Flow controlEnabled—Switch execution within an OP_IF / OP_NOTIF … OP_ENDIF block.
OP_ENDIF0x68104Flow controlEnabled—Close an OP_IF / OP_NOTIF / OP_ELSE block.
OP_VERIFY0x69105Flow controlEnabled—Mark the script invalid unless the top stack value is true; otherwise pop it.
OP_RETURN0x6a106Flow controlEnabled—Mark the output provably unspendable; commonly used to embed up to 80 bytes of data.
OP_TOALTSTACK0x6b107StackEnabled—Move the top item to the alt stack.
OP_FROMALTSTACK0x6c108StackEnabled—Move the top alt-stack item back to the main stack.
OP_2DROP0x6d109StackEnabled—Remove the top two stack items.
OP_2DUP0x6e110StackEnabled—Duplicate the top two stack items.
OP_3DUP0x6f111StackEnabled—Duplicate the top three stack items.
OP_2OVER0x70112StackEnabled—Copy the pair of items two spaces back to the top.
OP_2ROT0x71113StackEnabled—Move the fifth and sixth items to the top.
OP_2SWAP0x72114StackEnabled—Swap the top two pairs of items.
OP_IFDUP0x73115StackEnabled—Duplicate the top item only if it is non-zero.
OP_DEPTH0x74116StackEnabled—Push the current number of stack items.
OP_DROP0x75117StackEnabled—Remove the top stack item.
OP_DUP0x76118StackEnabled—Duplicate the top stack item (core of P2PKH).
OP_NIP0x77119StackEnabled—Remove the second-from-top item.
OP_OVER0x78120StackEnabled—Copy the second-from-top item to the top.
OP_PICK0x79121StackEnabled—Copy the n-th item (n from the top) to the top.
OP_ROLL0x7a122StackEnabled—Move the n-th item (n from the top) to the top.
OP_ROT0x7b123StackEnabled—Rotate the top three items.
OP_SWAP0x7c124StackEnabled—Swap the top two items.
OP_TUCK0x7d125StackEnabled—Copy the top item and insert it below the second item.
OP_CAT0x7e126SpliceDisabled—Concatenate two byte strings. Disabled for security in 2010.
OP_SUBSTR0x7f127SpliceDisabled—Return a substring. Disabled.
OP_LEFT0x80128SpliceDisabled—Return the left substring. Disabled.
OP_RIGHT0x81129SpliceDisabled—Return the right substring. Disabled.
OP_SIZE0x82130SpliceEnabled—Push the byte length of the top item (without popping it).
OP_INVERT0x83131Bitwise logicDisabled—Bitwise NOT. Disabled.
OP_AND0x84132Bitwise logicDisabled—Bitwise AND. Disabled.
OP_OR0x85133Bitwise logicDisabled—Bitwise OR. Disabled.
OP_XOR0x86134Bitwise logicDisabled—Bitwise XOR. Disabled.
OP_EQUAL0x87135Bitwise logicEnabled—Push 1 if the top two items are byte-equal, else 0 (core of P2SH).
OP_EQUALVERIFY0x88136Bitwise logicEnabled—OP_EQUAL then OP_VERIFY — fail unless the top two items are equal.
OP_RESERVED10x89137ReservedReserved—Invalidates the script if executed.
OP_RESERVED20x8a138ReservedReserved—Invalidates the script if executed.
OP_1ADD0x8b139ArithmeticEnabled—Add 1 to the top number.
OP_1SUB0x8c140ArithmeticEnabled—Subtract 1 from the top number.
OP_2MUL0x8d141ArithmeticDisabled—Multiply the top number by 2. Disabled.
OP_2DIV0x8e142ArithmeticDisabled—Divide the top number by 2. Disabled.
OP_NEGATE0x8f143ArithmeticEnabled—Flip the sign of the top number.
OP_ABS0x90144ArithmeticEnabled—Absolute value of the top number.
OP_NOT0x91145ArithmeticEnabled—Push 1 if the top number is 0, else 0.
OP_0NOTEQUAL0x92146ArithmeticEnabled—Push 0 if the top number is 0, else 1.
OP_ADD0x93147ArithmeticEnabled—Add the top two numbers.
OP_SUB0x94148ArithmeticEnabled—Subtract the top number from the second.
OP_MUL0x95149ArithmeticDisabled—Multiply the top two numbers. Disabled.
OP_DIV0x96150ArithmeticDisabled—Divide. Disabled.
OP_MOD0x97151ArithmeticDisabled—Modulo. Disabled.
OP_LSHIFT0x98152ArithmeticDisabled—Left bit-shift. Disabled.
OP_RSHIFT0x99153ArithmeticDisabled—Right bit-shift. Disabled.
OP_BOOLAND0x9a154ArithmeticEnabled—Push 1 if both numbers are non-zero, else 0.
OP_BOOLOR0x9b155ArithmeticEnabled—Push 1 if either number is non-zero, else 0.
OP_NUMEQUAL0x9c156ArithmeticEnabled—Push 1 if the two numbers are equal, else 0.
OP_NUMEQUALVERIFY0x9d157ArithmeticEnabled—OP_NUMEQUAL then OP_VERIFY.
OP_NUMNOTEQUAL0x9e158ArithmeticEnabled—Push 1 if the two numbers are not equal, else 0.
OP_LESSTHAN0x9f159ArithmeticEnabled—Push 1 if the second number is less than the top.
OP_GREATERTHAN0xa0160ArithmeticEnabled—Push 1 if the second number is greater than the top.
OP_LESSTHANOREQUAL0xa1161ArithmeticEnabled—Push 1 if the second number is ≤ the top.
OP_GREATERTHANOREQUAL0xa2162ArithmeticEnabled—Push 1 if the second number is ≥ the top.
OP_MIN0xa3163ArithmeticEnabled—Push the smaller of the top two numbers.
OP_MAX0xa4164ArithmeticEnabled—Push the larger of the top two numbers.
OP_WITHIN0xa5165ArithmeticEnabled—Push 1 if x is within [min, max).
OP_RIPEMD1600xa6166CryptographyEnabled—Hash the top item with RIPEMD-160.
OP_SHA10xa7167CryptographyEnabled—Hash the top item with SHA-1.
OP_SHA2560xa8168CryptographyEnabled—Hash the top item with SHA-256.
OP_HASH1600xa9169CryptographyEnabled—SHA-256 then RIPEMD-160 (address hashing).
OP_HASH2560xaa170CryptographyEnabled—Double SHA-256 of the top item.
OP_CODESEPARATOR0xab171CryptographyEnabled—Mark the point from which signature checks cover the script.
OP_CHECKSIG0xac172CryptographyEnabled—Verify a signature against a public key over the transaction.
OP_CHECKSIGVERIFY0xad173CryptographyEnabled—OP_CHECKSIG then OP_VERIFY.
OP_CHECKMULTISIG0xae174CryptographyEnabled—Verify m-of-n signatures (consumes one extra item — the off-by-one bug).
OP_CHECKMULTISIGVERIFY0xaf175CryptographyEnabled—OP_CHECKMULTISIG then OP_VERIFY.
OP_NOP10xb0176Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_CHECKLOCKTIMEVERIFY (OP_NOP2)0xb1177LocktimeEnabledBIP65Fail unless the output is spent at or after an absolute time/height (CLTV).
OP_CHECKSEQUENCEVERIFY (OP_NOP3)0xb2178LocktimeEnabledBIP112Fail unless a relative lock-time has elapsed (CSV).
OP_NOP40xb3179Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_NOP50xb4180Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_NOP60xb5181Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_NOP70xb6182Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_NOP80xb7183Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_NOP90xb8184Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_NOP100xb9185Reserved (NOP)Reserved—Upgradeable no-op reserved for a future soft fork.
OP_CHECKSIGADD0xba186CryptographyTapscriptBIP342Tapscript-only: verify a signature and add 1 to an accumulator (batch multisig).

Source: Bitcoin Core script/script.h (opcodetype enum) and the Bitcoin Wiki Script reference. Related: soft-fork registry, BIP index, transaction sizes, address types. See the open data hub.