Home › Fun & Games › Lights Out Game

Lights Out Game

Pressing a light toggles it and its four neighbors. Turn every light off in as few moves as you can. Every random board is guaranteed solvable, and the built-in solver can give a hint or the full solution.

Moves0
Minimum-
Lights on0
Time0:00

Turn off all the lights.

Pressing a light toggles it and its neighbors above, below, left and right. Keys: arrows to move, Enter or Space to press, H hint, U undo, N new game.

Advertisement
Advertisement

How to use the Lights Out Game

  1. Pick a board. 5x5 is the classic. Choose a difficulty and press New game.
  2. Press a light. Clicking a square toggles it and the squares directly above, below, left and right of it.
  3. Turn them all off. Plan your presses to switch off every light. The counter shows your moves against the minimum possible.
  4. Stuck? Press Show hint to light up one square from the shortest solution, or Show solution to mark every square you still need to press.
  5. Solve your own board. Turn on Edit mode, set the lights to match any puzzle, then use the solver.

How to solve Lights Out by hand: light chasing

You can solve any solvable 5×5 board without a computer using the light chasing method:

  1. Chase down. Starting with the top row, for every light that is on, press the square directly below it. Do this for rows 1 to 4. Now only the bottom row can have lights on.
  2. Look up the bottom row in the table below (1 = on, read left to right).
  3. Press the top-row squares shown in the table, then chase the lights down again exactly as in step 1. All lights are now off.
Bottom row lights left onPress in the top row
1 0 0 0 14th and 5th (0 0 0 1 1)
0 1 0 1 02nd and 5th (0 1 0 0 1)
1 1 1 0 02nd (0 1 0 0 0)
0 0 1 1 14th (0 0 0 1 0)
1 0 1 1 05th (0 0 0 0 1)
0 1 1 0 11st (1 0 0 0 0)
1 1 0 1 13rd (0 0 1 0 0)

If the bottom row shows any other pattern, the board is not solvable. Light chasing is easy to remember, but it rarely uses the fewest moves. The solution overlay in this game always shows a minimum solution.

The math behind Lights Out

Because pressing a square twice does nothing and the order of presses does not matter, Lights Out is a system of linear equations modulo 2. For an n×n board, each of the n² squares is a variable (press it or not) and each light gives one equation: the light ends up off if it was toggled an odd number of times when it started on, or an even number of times when it started off.

BoardSquaresSolvable patternsSolutions per solvable board
3×39All (29 = 512)1
4×4161 in 16 (212)16
5×5251 in 4 (223)4
6×636All1
7×749All1

The solver in this page runs Gaussian elimination over GF(2), then checks every combination of the null space vectors (4 on the 5×5 board, 16 on 4×4) and keeps the solution with the fewest presses.

Frequently asked questions

How do you play Lights Out?

The game is a grid of lights, some on and some off. Pressing any light toggles it and its orthogonal neighbors (up, down, left and right). The goal is to switch every light off. Pressing the same square twice cancels out, and the order of presses does not matter, so a solution is just a set of squares to press once.

Is every Lights Out puzzle solvable?

No. On the 5x5 board only 1 in 4 possible patterns can be solved, because the press matrix has a two-dimensional null space over GF(2). This game creates random boards by pressing random squares from the all-off state, which guarantees every board it gives you is solvable. In Edit mode the solver tells you if your custom board has no solution.

What is the fewest number of moves to solve 5x5 Lights Out?

Every solvable 5x5 board can be solved in at most 15 presses. Each solvable board has exactly four different solutions, and the solver here always shows the one with the fewest presses.

Is there a trick to solving Lights Out by hand?

Yes, the light chasing method. Go row by row from the top: for every light that is on, press the square directly below it. This clears all rows except the bottom one. Then look up the bottom row pattern in a small table, press the matching squares in the top row and chase the lights down again. The table is in the guide below.

How does the solver work?

Each press is a 0 or 1 variable and each light gives a linear equation modulo 2. The solver uses Gaussian elimination over GF(2) to find one solution and the null space, then tries every combination of null space vectors and keeps the solution with the fewest presses.

Who invented Lights Out?

Lights Out was released as a handheld electronic game by Tiger Electronics in 1995. Earlier puzzles with the same toggling idea existed, such as Merlin's Magic Square in the 1970s, and the mathematics behind it has been studied since the 1980s.

Related tools

Sliding PuzzlePlay the 15 puzzle and 3×3 to 6×6 sliding tile puzzles with numbers or your own photo.Sudoku OnlinePlay free Sudoku with 4 difficulty levels, notes, hints and a timer.MinesweeperPlay classic Minesweeper: 3 difficulties, flags, timer and a safe first click.Mastermind GameCrack the secret 4-color code in 10 tries using black and white feedback pegs.SolitairePlay classic Klondike Solitaire with Draw 1 or Draw 3 and undo.Spider SolitairePlay Spider Solitaire online with 1, 2 or 4 suits, hints, unlimited undo and a timer.Play Chess vs ComputerPlay chess online against the computer at 8 difficulty levels.Connect FourPlay Connect 4 online against the computer or a friend.Snake GamePlay classic Snake online with speeds, wall modes and high scores.Tic Tac ToePlay tic tac toe against an unbeatable AI or a friend.Block Puzzle GameClassic falling blocks puzzle game with levels and high score.2048 GamePlay 2048 online with swipe controls, undo and best score.Coin FlipFlip a coin online: heads or tails, multiple coins and stats.Yes or No WheelSpin the wheel for a yes or no answer to any question.Random Name GeneratorGenerate random first and last names by gender and origin.Random Team GeneratorSplit a list of names into random, balanced teams.Zodiac Sign CalculatorFind your zodiac sign, element and best matches from your birthday.Zodiac CompatibilityCheck love compatibility between two zodiac signs.Love CalculatorEnter two names and get a fun love compatibility score.Dice RollerRoll a D6 or any RPG dice (D4 to D100) with totals and history.Random Number GeneratorPick random numbers in any range, unique or lottery-style.Random Letter GeneratorPick random letters from the alphabet, with vowel, case and no-repeat options.Random Country GeneratorPick random countries with flags, capitals, population and area.Random Date GeneratorGenerate random dates between two dates, with weekday and format options.Numerology CalculatorFind your life path, expression and soul urge numbers from name and birthday.Birth Flower & Birthstone FinderLook up the birthstones and birth flowers for any month, with meanings.Picker WheelSpin a wheel to pick a random name or choice.Random Dog PicturesRandom dog photos and fun dog facts.Random Cat PicturesRandom cat photos and fun cat facts.Random Parrot PicturesRandom parrot photos and bird trivia.Dog Web StumbleJump to a random dog website.Cat Web StumbleJump to a random cat website.Parrot Web StumbleJump to a random parrot website.Random Animal GeneratorGet a random animal with its class, habitat and a fun fact, with filters.Word Guess GameGuess the hidden five-letter word in six tries. Unlimited games, stats and hard mode.Rising Sign CalculatorFind your ascendant sign and degree from birth date, time and place.Random Movie PickerCan't decide what to watch? Pick a random film by genre, decade and runtime.HangmanClassic friendly hangman word game with categories, hints and difficulty levels.Tarot Card ReadingDraw a free tarot spread from a full 78-card deck with upright and reversed meanings.Random Food PickerCan't decide what to eat? Spin a cuisine wheel and get a dish that fits your diet.Memory Card GameFlip cards and match emoji pairs on 4×3 to 6×6 grids, with moves, timer and best scores.Fortune Cookie GeneratorCrack a virtual fortune cookie for an original fortune, lucky numbers and a daily pick.Truth or Dare GeneratorDraw clean truth or dare questions for family, teens or parties, with player turns.Flappy GameTap to flap a round chick through bamboo gaps and beat your high score.Baby Name GeneratorDiscover 1,700+ baby names filtered by gender, origin and letter, and save favorites.Would You Rather QuestionsRandom would you rather dilemmas in five categories. Vote and see your A/B split.Dino Runner GameJump cacti and duck buzzing beetles in an original endless desert runner.Pet Name GeneratorFind the perfect name for a dog, cat, bird or bunny by species, style and coat color.Never Have I Ever QuestionsClean and party never have I ever questions with a built-in point counter for players.Typing GameType the falling words before they land; level up and track your WPM and accuracy.Fantasy Name GeneratorCreate elf, dwarf, orc, dragon and other fantasy names from race-specific syllable rules.Chinese Zodiac CalculatorFind your Chinese zodiac animal, element and yin or yang from your exact birth date.Random Question GeneratorRandom conversation starters: icebreakers, deep, funny, work-friendly and kids questions.Math Quiz GameTimed mental math rounds with four operations, five levels, streaks and high scores.Username GeneratorGenerate cool usernames and gamertags by style, fitted to each platform's rules.Magic 8 BallAsk a yes-or-no question, shake the ball and get one of the 20 classic answers.Flag QuizGuess the flags of all 196 countries in four modes, from multiple choice to timed.Band Name GeneratorInvent band names for 14 music genres, or blend two genres, with album titles too.Writing Prompt GeneratorRandom story starters, first lines, characters, settings, twists and poem prompts in 11 genres.Map QuizFind countries on a clickable world map or name the highlighted one, by continent.Drag Name GeneratorFind your drag queen or drag king name: puns built from your own name in seven styles.Fantasy Creature GeneratorInvent original fantasy creatures with a name, body, powers, habits, weakness and danger level.Periodic Table QuizLearn all 118 elements: quiz symbols, names and atomic numbers or click them on the table.Rapper Name GeneratorTurn your name into a rap name in seven styles, from Lil and MC to trap, drill and emo rap.Lottery Number GeneratorSecure random quick picks for Powerball, Mega Millions, EuroMillions, Lotto and custom games.Spelling Bee GameMake words from 7 honeycomb letters, always using the center letter. New daily puzzle.Superhero Name GeneratorInvent original superhero names with powers, an origin story and a weakness.Secret Santa GeneratorDraw Secret Santa names with exclusions and send everyone a private reveal link, no sign-up.Jigsaw PuzzleTurn a sample picture or your own photo into a 12 to 150 piece jigsaw puzzle and solve it.Pirate Name GeneratorGet swashbuckling pirate names from your first name, plus ship names, in four styles.Raffle DrawPaste names, add extra tickets and draw one or many random raffle winners with confetti.Couple Name GeneratorBlend two names into ranked ship names and couple names, from Brangelina-style to overlaps.Random Card DrawShuffle a 52-card deck and draw one or more random playing cards, with jokers and history.Mahjong SolitaireMatch pairs of free tiles to clear the Turtle and two smaller layouts, with hints, shuffle and undo.Age on Other PlanetsSee how old you are on Mars, Jupiter and every other planet, plus your next birthdays.Anagram SolverFind every anagram of a word or phrase: single words, multi-word anagrams and all sub-words.Scrabble Word FinderFind the highest-scoring words from your rack, with blank tiles, patterns and bingo bonus.Wordle SolverEnter your guesses and colours to see every possible answer and the best next guess.Crossword SolverFind words that fit a crossword pattern like c?t from the length and the letters you know.Word Search GeneratorMake a word search puzzle from your words, play it online or print it with an answer key.Pong GamePlay classic Pong online against the computer on 3 levels or with a friend, first to 11.Breakout GameClassic brick breaker game with levels, power-ups and lives. Play with mouse, touch or keyboard.Whack-a-MoleWhack the moles before they hide in 30 or 60 second rounds. Speed increases, best score saved.Simon Says GameRepeat the growing color and sound sequence. Classic memory game with strict mode and high score.Rock Paper ScissorsPlay rock paper scissors vs the computer in best-of matches, with stats and a lizard-Spock mode.CheckersPlay checkers online against the computer or a friend, with kings, undo and hints.ReversiPlay Reversi (Othello rules) online vs a 3-level computer or a friend, with move hints.GomokuGet five in a row on a 15×15 board against a smart computer or a friend.Battleship GamePlace your fleet and sink the computer's ships in this classic naval guessing game.FreeCellPlay FreeCell solitaire online with the classic numbered deals, undo, hints and auto-move.Tower of HanoiPlay the Tower of Hanoi puzzle with 3 to 8 disks, or watch it solve itself in the fewest moves.Maze GeneratorCreate random mazes in any size, solve them with the arrow keys, then print or save as PNG.Sudoku SolverType in any Sudoku and solve it instantly, get step-by-step hints and check it has one solution.Bingo Card GeneratorMake printable 75-ball or custom word bingo cards, from 1 to 200 unique cards, as PDF or print.Bingo Number GeneratorFree bingo caller for 75 or 90 balls with a live board, auto-call timer and spoken numbers.Online ScoreboardKeep score for any game: big team scores, game clock, periods, fullscreen and sport presets.Tournament Bracket GeneratorMake single or double elimination brackets for 2-64 players, click winners to advance, print.Trivia Quiz300+ general knowledge trivia questions in 10 categories. 10-question rounds with a timer and score.Random Fact GeneratorGet random fun facts about animals, space, the body, history, science, food and more.Random Joke Generator200+ clean, family-friendly jokes: dad jokes, puns, knock-knock jokes and more. Tap to reveal.Random Riddle Generator150+ riddles with hidden answers in easy, hard and kids levels. Guess, get a hint or reveal.Team Name GeneratorGenerate catchy team names for sports, work, trivia nights and gaming, with your own keyword.Business Name GeneratorTurn a keyword and industry into brandable business name ideas, with a .com check link.Charades GeneratorRandom charades words by category and difficulty, with a round timer, team scores and kids mode.Dots and BoxesPlay Dots and Boxes online vs a smart computer or a friend, on boards from 3×3 to 8×8.Nonogram PuzzlePlay unlimited nonogram (picross) puzzles from 5×5 to 15×15, each with one unique solution.Life in WeeksSee your life as a grid of weeks: weeks lived, weeks left, milestones and a printable poster.Crossword Puzzle MakerTurn a list of words and clues into a crossword you can play online, share or print.Pyramid SolitairePlay Pyramid Solitaire online: pair cards that add up to 13 and clear the pyramid.Yacht Dice GamePlay the classic 5-dice scoring game solo for a high score or against a friend.MancalaPlay Mancala (Kalah rules) online against a smart computer or a friend on one screen.Pictionary Word GeneratorRandom family-friendly drawing words by difficulty, with a round timer and team scores.Random Emoji GeneratorGenerate random emojis by category, copy them in one click, or roll an emoji story prompt.