Updated:

A standard potion by version

VersionSwiftness II
Java 1.20.5+/give @p minecraft:potion[potion_contents={potion:"minecraft:strong_swiftness"}]
Java 1.20.4 and earlier/give @p minecraft:potion{Potion:"minecraft:strong_swiftness"}
Bedrock/give @p potion 1 16

Java 1.20.5 replaced item NBT in { } with components in [ ]. Using the other version's format gives an error or a water bottle.

Potion IDs (Java)

These are the brewable potions. Add long_ for the extended version and strong_ for level II.

PotionIDVariants
Swiftnessswiftnesslong_ / strong_
Healinghealingstrong_
Regenerationregenerationlong_ / strong_
Strengthstrengthlong_ / strong_
Fire Resistancefire_resistancelong_
Night Visionnight_visionlong_
Invisibilityinvisibilitylong_
Water Breathingwater_breathinglong_
Leapingleapinglong_ / strong_
Slow Fallingslow_fallinglong_
Turtle Masterturtle_masterlong_ / strong_

Java 1.21 added wind_charged, weaving, oozing and infested.

Custom effects, level and duration

/give @p minecraft:potion[potion_contents={custom_color:16711680,custom_effects:[{id:"minecraft:speed",amplifier:4,duration:6000},{id:"minecraft:night_vision",amplifier:0,duration:6000}]}]
FieldMeaning
idThe effect ID, such as speed, not the potion name
amplifierLevel counted from 0: 0 is I, 4 is V
durationTicks; 20 ticks is one second, so 6000 is five minutes
custom_colorLiquid color as a decimal RGB value; 16711680 is red

On 1.20.2–1.20.4 the list is called custom_potion_effects:

/give @p minecraft:potion{custom_potion_effects:[{id:"minecraft:speed",amplifier:4,duration:6000}]}

Earlier versions used CustomPotionEffects with numeric IDs. The potion generator writes the right format for your version.

Splash, lingering and tipped arrows

TypeItem ID
Drinkableminecraft:potion
Splashminecraft:splash_potion
Lingeringminecraft:lingering_potion
Tipped arrowminecraft:tipped_arrow
/give @p minecraft:splash_potion[potion_contents={potion:"minecraft:strong_healing"}] 3

Only the item ID changes. Lingering potions and tipped arrows give shorter effects than the drinkable potion.

Bedrock data values

Bedrock uses /give @p potion <amount> <data>. Use splash_potion or lingering_potion with the same number.

PotionData value
Night Vision5
Invisibility7
Fire Resistance12
Swiftness14 (II is 16)
Water Breathing19
Healing21 (II is 22)
Regeneration28
Strength31

Bedrock /give cannot make custom effects. Apply them directly with /effect instead.

When it does not work

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.