Skip to main content

Explain Code

Replit AI can give you step-by-step natural language explanations of your code with Explain Code. This feature is especially useful when trying to understand other people's code or code you wrote in the past.

Consider this example from 100 Days of Code. Follow these steps:

  1. Select the block of code you want explained.
  2. Right-click in the editor to open up the context menu.
  3. Select Explain code from the context menu and wait for Replit AI to generate an explanation for the code you selected.
  4. Once your explanation has been generated, you'll see a step-by-step walkthrough of the code you selected.
  5. If the explanation wasn't helpful, you can have Replit AI try again by pressing the Retry.
  6. Want to ask a followup to the explanation? Press Reply in Chat and you will be redirected to the Chat interface where you can ask follow up questions.