Pick an item and its enchantments, at any level up to 255, and copy the /give command. Use the button to add every enchantment that fits the item in one click, or put any enchantment on anything.
How to use the command
Commands need cheats on (single player: Open to LAN, Allow Cheats) or operator rights on a server.
A long command does not fit in chat (256 characters). Paste it into a command block instead (/give @p command_block), or run it from the server console without the /.
Pick your version: the command changed in 1.20.5 and again in 1.21.5, and a command for another version is refused.
Good to know
Levels go up to 255. Above X, the game has no roman numeral, so the tooltip shows the raw text enchantment.level.11 and so on. The enchantment still works at that level, but some stop getting stronger: Protection, for example, is capped by the game.
A command can put enchantments on items that could never get them in survival, and can mix ones that normally clash (Sharpness with Smite, Silk Touch with Fortune, Infinity with Mending).
An enchanted book keeps its enchantments as "stored" ones, ready for an anvil. The tool writes that for you when the item is enchanted_book.
Mace enchantments (Density, Breach, Wind Burst) need 1.21 or newer, Lunge and the spears need 1.21.11 or newer.
Something wrong or missing here? Tell me, requests decide what I add next. More tools: all tools.