D, T, and JK Flip-Flops

Flip-flops are essential two-state memory circuits in Minecraft that update their stored output only on the exact rising or falling edge of a clock signal. Unlike basic latches that stay open while enabled, edge-triggered flip-flops give you precise, synchronized control over data storage and state toggling. This guide covers how to build classic redstone D, JK, and T flip-flops from fundamental logic components.

Memory CircuitsIntermediateJava Edition
D, T, and JK Flip-Flops video tutorial

Video: Redstone Circuits 4: Flip-Flops (D, T, and JK) by bennyscube

How to build it

  1. Build the Master Gated D-Latch (D Flip-Flop)

    Start your D flip-flop by building a basic gated D-latch to act as the 'master' stage. Connect your Data input lever to the latch input, and keep its enable line powered by default using an inverted clock signal.

  2. Add the Slave Gated D-Latch

    Build a second identical gated D-latch directly behind the first one to act as the 'slave' stage. Route the output of the first latch directly into the data input of this second latch.

  3. Connect the Shared Clock Line

    Wire a single Clock input lever to control the enable lines of both latches in opposite states. When the clock turns on (rising edge), it disables the first latch to lock in the data while simultaneously enabling the second latch to pass that saved state to the final output.

  4. Construct an SR Latch Base (JK Flip-Flop)

    To start the JK flip-flop, build a standard two-torch SR (Set-Reset) latch on the ground. This forms the two-state memory core that holds your output independently of the inputs.

  5. Convert the SR Latch into a JK Latch

    Upgrade the SR latch into a JK latch by feeding the two outputs back toward the front input lines and placing inverting redstone torches on the Set (J) and Reset (K) input blocks. This feedback wiring allows the latch to toggle states if both inputs are activated at the same time.

  6. Build the Clock Edge Trigger

    Place a solid block for your central Clock input between the J and K lines with a redstone torch attached to it. Run a direct un-delayed redstone wire from the clock block into both the J and K internal lines, and run a second path from the attached torch through repeaters set to a 3-tick delay into those same lines.

  7. Test the JK Flip-Flop Inputs

    Add levers for Set (J), Reset (K), and the central Clock. Because the clock line normally holds both internal lines powered and only briefly drops power during a falling-edge transition, flipping the clock will cleanly Set, Reset, or Toggle the output based on which inputs are active.

  8. Modify into a T Flip-Flop

    To turn the JK flip-flop into a T (Toggle) flip-flop, simply break and remove the outer Set (J) and Reset (K) input blocks and their torches. Leaving only the central edge-triggered Clock line connected to both sides of the feedback latch forces the circuit to toggle its output state every time the clock is triggered.

How it works

What separates a flip-flop from a basic latch is an edge trigger on the enable (clock) line. An edge is the exact instant a redstone wire changes state—either from off to on (rising edge) or from on to off (falling edge).

  • D (Data) Flip-Flop: Uses a master-slave arrangement of two gated D-latches working like an airlock. When the clock is off, the first latch is open and reads the Data input while the second latch is closed. On the rising edge of the clock, the first latch locks immediately before the second latch opens, capturing the exact data value at that moment and preventing further changes until the next clock cycle.
  • JK Flip-Flop: Combines a feedback-wired SR latch with a pulse-shaping edge detector on the clock line. The clock block powers both control wires directly, while a redstone torch on the block powers them through a 3-tick repeater delay. When the clock turns off, the direct power drops immediately while the torch and repeaters take a moment to turn back on. This creates a brief off-pulse (edge trigger) that allows the active J (Set) or K (Reset) state—or both, causing a toggle—to flip the output once without oscillating wildly.
  • T (Toggle) Flip-Flop: By removing the J and K override torches from the JK flip-flop, both sides remain armed to toggle. Every time the clock edge trigger fires its short off-pulse, the active output side feeds back to flip the opposite side of the latch.

Tips & variations

  • Shorter D Flip-Flop Variant: While the two-stage master-slave D flip-flop is great for understanding airlock logic, you can make a much smaller D flip-flop by taking a single gated D-latch and attaching a simple pulse limiter (edge trigger) directly to its enable wire.
  • Timing the Edge Trigger: On the JK and T flip-flops, make sure the repeaters coming off the clock's redstone torch are set to a 3-tick delay. If the delay is too short, the off-pulse won't last long enough to flip the SR latch; if it is too long, the latch may toggle twice on a single clock press.
  • Java vs. Bedrock: Because these classic designs rely purely on fundamental redstone dust, torches, and repeaters rather than piston mechanics, the logic principles work reliably across both Java and Bedrock editions.

Frequently asked questions

What is the difference between a latch and a flip-flop in Minecraft?
Both circuits store two states independently of their inputs, but a flip-flop always includes a clock (enable) input that is edge-triggered. This means a flip-flop only updates its output at the exact instant the clock signal turns on or off, whereas an enabled latch lets signals pass through continuously.
What is a rising edge vs. a falling edge?
A rising edge is the exact moment a redstone wire goes from unpowered (0) to powered (1). A falling edge is the moment a wire goes from powered (1) back to unpowered (0).
How does a JK flip-flop differ from an SR latch?
In a standard SR latch, powering both Set and Reset at the same time creates an invalid state. A JK flip-flop routes the outputs back to the inputs and uses a clocked edge trigger so that powering both inputs simultaneously cleanly toggles the output state once per clock pulse.
When should I use a T flip-flop?
Use a T flip-flop whenever you want to convert a temporary pulse—such as a button press or a clock edge—into a permanent toggle that switches a device on with the first press and off with the next.

Components used

More jk flip-flop