Preheat your air fryer to 400°F (200°C). Preheating ensures that the corn starts cooking immediately and helps achieve that slightly charred exterior we are looking for.
While the air fryer is warming up, shuck the corn and remove all the silk. If the ears are too long to fit in your air fryer basket, feel free to snap or cut them in half.
In a small bowl, mix the melted butter (or olive oil) with the salt, pepper, and any optional spices like garlic powder or paprika. Use a pastry brush or your hands to coat each ear of corn thoroughly with the seasoned butter mixture.
Place the seasoned corn in the air fryer basket in a single layer. Do not stack them; leave a little space between each ear so the air can circulate properly. Cook for 12 to 15 minutes.
Halfway through the cooking time (around the 7-minute mark), open the basket and use tongs to rotate the corn. This ensures even browning. Continue cooking until the kernels are tender and slightly golden brown.