إِن تُبْدُوا الصَّدَقَاتِ فَنِعِمَّا هِيَ ۖ وَإِن تُخْفُوهَا وَتُؤْتُوهَا الْفُقَرَاءَ فَهُوَ خَيْرٌ لَّكُمْ ۚ وَيُكَفِّرُ عَنكُم مِّن سَيِّئَاتِكُمْ ۗ وَاللَّهُ بِمَا تَعْمَلُونَ خَبِيرٌ (271)
(2:271) If you practise charity publicly, it is good; but if you give charity secretly to the needy, it is much better for you, *311 for this will expiate many of your sins. *312 Anyhow, Allah is well aware of whatever you do.
*311). If charity is of an obligatory nature it is preferable to dispense it openly. Non-obligatory charity should preferably be dispensed secretly. This principle applies to all acts. As a rule, it is more meritorious to perform obligatory acts openly and non-obligatory acts of goodness, secretly .
*312). The performance of good deeds in secret leads to the continual improvement of one's life and character. One's good qualities develop fully and one's bad qualities gradually wither away. This makes a man so acceptable to God that He pardons the sins that he might have committed.