From the Super Mario Wiki
First appearing in Super Mario Bros. 2, there is no apparent consensus as to the "proper" interpretation of Ninji's original NES sprite. In some games and official artwork, Ninji appears to be rendered as a white creature with beady, black eyes and a purple or black ninja-like outfit with red buttons; but in other appearances, it's rendered as a smiling, purple creature with white eyes, cat ears, a red mouth, and pointed teeth.
Super Mario series
Super Mario Bros. 2
Ninjis make their debut appearance in Super Mario Bros. 2 and also appear in the game's SNES remake, which is part of Super Mario All-Stars, and its Game Boy Advance remake, Super Mario Advance (despite not being mentioned in the instruction manual). In these games, Ninjis serve Wart, the tyrannical ruler of the dream world known as Subcon. There are two types of Ninji: the first type charges at Mario, suddenly jumping as it approaches; the second type remains in one place and jumps up and down. In Super Mario Advance, Giant Ninjis appear as somewhat rare enemies. These giant Ninjis use the same attack pattern as their smaller counterparts, either jumping in place or charging towards a character. Like most enemies in Super Mario Bros. 2 and its remakes, all variations of Ninjis can be picked up and thrown at other enemies to defeat them. If the player picks up and throws a Giant Ninji, it will yield a heart upon defeat if it lands on a solid surface.
Super Mario World
Ninjis also appear in Super Mario World, using their same sprites from the NES version of Super Mario Bros. 2. In this game, they serve Bowser during his rule of Dinosaur Land. They make their sole appearance in Bowser's Castle, where they blend in the darkness and are difficult to see unless the searchlight is activated. The Mario Mania Player's Guide (1991) describes Ninjis as Mini-Ninjas, stating that they have been driven insane by their long isolation in Bowser's Castle. It is unknown if these Ninjis are still manifested from dreams like their Super Mario Bros. 2 counterparts, or if they are a naturally occurring species in the Mushroom World. They jump in place and can be defeated with stomps, fireballs, or a cape attack. They are one of the few enemies not seen in the credits.
The Super Mario Bros. Super Show!
Despite appearing prominently in its opening sequence, Ninjis only appear once in The Super Mario Bros. Super Show!, in the episode "Karate Koopa", where they aid Karate Koopa in his plan to capture Princess Toadstool and sell her into slavery for a fortune. Somewhat parodying their namesake, they are skilled in hand-to-hand combat and speak in thick Japanese accents.
Super Mario World television series
In the Super Mario World animated series, Ninjis, here brown in color, appear in the episode "The Yoshi Shuffle" as spectators to Yoshi and Mario's football game against Bully, Big Mouth and Cheatsy and several Koopa Football Players in the Neon Castle.
Nintendo Comics System
In Nintendo Comics System, Ninjis only make minor appearances, with one appearing in the background of the story The Legend, while several, having been beaten senseless by a sleepwalking Mario who believes himself to be Dirk Drain-Head, appear in Bedtime for Drain-Head.
Nintendo Adventure Books
In Unjust Desserts, some Ninji are shrunk by Magikoopa and eaten by Yoshi, though Mario never encounters any in the dinosaur's body, only in the palace garden. In Brain Drain, if Luigi (who has had his mind switched with a Koopa Troopa's due to the Synapse Switcher) gets a serving of gooey rations in the cafeteria of Iggy Koopa's base, a Ninji he sits beside will tell him that the gray gunk is better than the blue. Some Ninjis are also spotted loitering around the WMUSH radio station when Iggy takes it over.
Super Mario Adventures
In Super Mario Adventures, spear-wielding Ninjis make several appearances, first appearing in the siege of Princess Toadstool's Castle. Ninjis also appear when Princess Toadstool attempts to escape her confinement in the Koopalings' Tower, aiding Wendy O. Koopa and a brigade of Koopa Troopas in stopping her escape. Later, a Ninji, apparently buying a camera from Friendly Floyd, appears at Bowser's wedding to Princess Toadstool.
The Ninjis in Hotel Mario are called Mini Ninjas but otherwise are no different from any other variety.
Paper Mario series
Paper Mario: Sticker Star
After a long absence, Ninjis appear again in Paper Mario: Sticker Star. They appear in the forest world as enemies. In the overworld, Ninjis tend to hide in the poisoned waters or trees of the forest levels. In battle, a Ninji can either turn itself into a throwing star and hurl itself at Mario or it can just run up to Mario and slam him. Mario must watch the positions of Ninjis; if they are jumping, they cannot be hammered and if they are standing still, they cannot be jumped on. If they are jumped on/hammered at the wrong time, they will disappear and leave a log behind, then run back into battle. Sometimes after battle, a Ninji may occasionally drop a Throwing Star sticker when defeated.
Mario vs. Donkey Kong
Mario Party Advance
In Mario Party Advance, Ninji lives on the first floor of Horror Condo. His quest involves getting him a rare Toad Force V DVD; the aforementioned DVD is only owned by Mushbert, who lives in the Mushroom Condo. After giving Ninji the DVD, he gives the player Tile Trial, a Gaddget. The ending states that he gives up cartoons and sells the DVD.
Names in other languages