I have an Arduino Uno R3 board and I compiled a test code. But now I'm trying to delete it. There are many tutorials with the same way, that is rewrite BLANK CODE. But it's not the genuine way. I want to delete all code that I manually compiled. Because the previous code will also take space in memory and after some time memory will be full. Is there anyone who has the right solution for this problem? Thanks in advance.

2 Answers 2


Every time you rewrite an Arduino, the previous code is completely wiped out (except for the bootloader, which doesn't change).

You will not fill up your arduino -- it is not like a filesystem where you are continually adding new files. Each new programming/upload overwrites all the existing code.

Uploading a blank sketch is the genuine way to "erase" an unwanted program from an arduino.


When you upload a new sketch the flash memory (Arduino hard disk) is deleted completely and the new sketch is loaded.

If you want a blank code, just upload:

void setup() {

void loop() {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.