See the article If you see duplicate contacts after setting up iCloud Contacts - Apple Support
When Apple ID is signed in Mac and application contact is turned on Set up iCloud features on Mac – Apple Support
If you select duplicate contacts from Mac and delete them , automatically they will be deleted from iCloud.com
The duplicates contacts ( they will be under iCloud section > in All iCloud ) are shown in Mac address book as well as in iCloud.com if these duplicate contacts are selected from Mac address book use command and A keys and click on command and delete key they will be deleted condition they must be in series and not randomly placed , as important contacts will also be deleted .
If they are randomly placed select important contacts that are not to be deleted in on my Mac section , just select use command and A keys , copy use command and C keys and paste use command and V keys .
The duplicate contacts can also be in various groups in iCloud.com Create a group of contacts on iCloud.com - Apple Support created and they will be shown in All contacts of Mac address book ( see the first option ) .
You need to find out duplicate contacts of address book search from various groups , All contacts , All iCloud and another way is create a group name as say duplicate contacts1 find out all duplicates and club in this folder and finally delete this folder it will be removed from address book / iCloud.com
The Iphone / iPad are synced , the duplicate contacts will be deleted .