An embedding theorem for Sobolev spaces built upon general Musielak-Orlicz norms is offered. These norms are defined in terms of generalized Young functions which also depend on the x variable. Under minimal conditions on the latter dependence, a Sobolev conjugate is associated with any function of this type. Such a conjugate is sharp, in the sense that, for each fixed x , it agrees with the sharp Sobolev conjugate in classical Orlicz spaces. Both Sobolev inequalities in the whole R n and Sobolev-Poincar & eacute; inequalities in domains are established. Compact Sobolev embeddings are also presented. In particular, optimal embeddings for standard Orlicz-Sobolev spaces, variable exponent Sobolev spaces, and double -phase Sobolev spaces are recovered and complemented in borderline cases. A key tool, of independent interest, in our approach is a new weak type inequality for Riesz potentials in Musielak-Orlicz spaces involving a sharp fractional -order Sobolev conjugate. (c) 2024 The Author(s). Published by Elsevier Inc. This is an open access article under the CC BY -NC -ND license (http://creativecommons .org /licenses /by -nc -nd /4 .0/).