A fast, nondestructive optical method for analyzing defects in two-dimensional materials has been developed, with applications in electronics, sensing, early cancer diagnosis and water desalination.