The fool doth think he is wise, but the wise man knows himself to be a fool.
Attribution checked
Quothly found supporting evidence for this attribution.
The line appears in Shakespeare’s play As You Like It (spoken by Touchstone, Act 5, scene 1), and is documented on the Folger Shakespeare site (earlier similar proverbs are noted but the wording is in Shakespeare).
Folger Shakespeare Library - Thine Own Self