Our Mid 2011 iMac 21.5 runs fine with 12GB RAM. It never reports being starved for RAM. You can evaluate RAM usage easily, keeping in mind that since os 10.9 in Late 2013, "RAM used" is no longer a viable metric for Macs:
See memory usage for your Mac in Activity Monitor - Apple Support
If Pressure is in the green and Swap is trivial (under about 500MB), you do not have a RAM issue.
Why are you wanting to add RAM? Slowness? If so, and based on long history here, you could be wasting your money on RAM.
Take this quiz:
- Is the computer slow to boot?
- Are apps, especially big ones like Office, slow to launch.
- Once launched, do those apps seem to work OK?
Three "yes" answers say at you do not have a RAM issue but a hard drive issue.
The entry-level drive in that model is actually about 30 percent faster than the entry-level drives Apple used in 2012-2019 iMac 21.5s. However it still feel slow, and there is not much tou can do about it without gutting the computer to install an internal SSD. The labor change could easily be more than the cost of a compatible 500GB SSD.
Had you a 2012 or late model, there would be a cost-effective external SSD option, but it will not help yours. Your iMac has USB2 ports, not the required USB3 for the external option. The external on yours would be slower than it is now.
That said, if your computer is slow and you desire a data-driven evaluation to confirm my suspicion or find other causes here where we cannot see, touch, nor remotely access your iMac, you can post a system configuration snapshot. Fortunately there is a safe, secure way to do that without our playing a protracted game of "20 Questions" that could go on for days.
We can quickly and within the confines of these forums help you determine what issues are at play if you use EtreCheck Pro, available here:
https://etrecheck.com/index
The free version will do nicely for this purpose, although the app is worthy of our financial support.
We can see hard data about drive performance, software issues, and RAM usage. Etrecheck is the development of a long-serving and trusted contributor here expressly for displaying information in these forums to help us help you. It will not reveal any personal or secure information.
To be able to successfully post the long report here, please see this excellent user tip:
How to use the Add Text Feature When Post… - Apple Community